|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi,
I would like to have the code through which I can connect to MySql database in ASP. I am able to connect through VB but when I try to use the same connection string in ASP, I am getting an error saying that it is an invalid attribute. Anyone please let me know about this at the earliest. |
|
#2
|
|||
|
|||
|
Here is the code you want
Hi,
Can you send me the code that connects VB to MySQL. Here is the code for ASP to MySQL connection. -------------------------------------------------------------------------- <%@ Language=VBScript %> <% Dim my_conn, strSQL, rs Set my_conn = createobject("ADODB.Connection") my_conn.open = "DRIVER={MySQL ODBC 3.51 Driver};"_ & "SERVER=localhost;"_ & "DATABASE=C:\Program Files\mysql\data\wine;"_ & "UID=root;"_ & "PWD=;" strSQL = "SELECT * FROM wine" Set rs = conn.Execute(strSQL) ' Do until it reaches end of db Do while not rs.eof Response.Write "Name: " & rs("customers") & "<br>" 'Response.Write "FirstName: " & rs("FirstName") & "<br>" 'Response.Write "LastName: " & rs("LastName") & "<br>" rs.MoveNext 'Next record loop my_conn.close ' Close database connection Set my_conn = nothing 'obj variable released %> -------------------------------------------------------------------------------- |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > connect to MySql database in ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|