web 2.0

How to use ASP & MySQL Connect to Database

How to use ASP & MySQL Connect to Database This is tutorial asp developers how to using asp connect to MySQL database.

ShotDev Focus:
- ASP & MySQL (Connect to Database)

Example

asp_mysql_connect.asp


<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
On Error Resume Next    '*** Not Show ASP Error  ***'
Dim Conn
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost;UID=root; " & _
"pwd=root;database=mydatabase;option=16384;"

If Err.Number <> 0 Then
Response.write("(MySQL) Database cannot connect Error = "&Err.Description&"<br>")
Else
Response.write("(MySQL) Database connected.<br>")
End If
Conn.Close()
Set Conn = Nothing
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_mysql_connect.asp

Screenshot

ASP & MySQL
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

One Response to “How to use ASP & MySQL Connect to Database”

  1. 3fraught…

Leave a Reply

You must be logged in to post a comment.