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
3fraught…
…