|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help regarding the "Using MyODBC To Access Your MySQL Database Via ASP" article
Hello,
I am pretty new to ASP and I have a problem using it with mySQL. I am using ODBC on my Win 2000 server for ASP application. I have set up an ODBC driver (3.51) for mySQL and was able to create a local database. I am facing a rather interesting problem: I followed the instruction from a tutorial and set up a system DSN called personalweb. After verifying the connection, I continued on and created a sample ASP page to test it: <% on error resume next dim adoConn dim adoRS dim counter set adoConn = Server.CreateObject("ADODB.Connection") set adoRS = Server.CreateObject("ADODB.Recordset") adoConn.Open "DSN=personalweb" adoRS.ActiveConnection = adoConn if adoConn.errors.count = 0 then response.write "<h2>Fields In The 'ruser' Table:</h2>" adoRS.Open "describe ruser" while not adoRS.EOF response.write adoRS.fields(0).value & "<br>" adoRS.MoveNext wend else response.write "ERROR: Couldn't connect to database" end if %> Everything works, the columns were shown in the ASP page... Now, the problem is when I continued on and follow the second instruction in the tutorial and subsitute what I had with the following code: <% on error resume next dim adoConn dim adoRS dim counter set adoConn = Server.CreateObject("ADODB.Connection") set adoRS = Server.CreateObject("ADODB.Recordset") adoConn.Open "driver= {mysql};database=personalinfo;server=localhost;uid =adminbchiu;pwd=qwerty;" adoRS.ActiveConnection = adoConn if adoConn.errors.count = 0 then response.write "<h2>Fields In The 'ruser' Table:</h2>" adoRS.Open "describe ruser" while not adoRS.EOF response.write adoRS.fields(0).value & "<br>" adoRS.MoveNext wend else response.write "ERROR: Couldn't connect to database" end if %> The only thing I can get is the error message. I am wondering what I have done wrong... Please help. Thanks |
|
#2
|
|||
|
|||
|
OBDC Driver
Hello
You need to enter the name of your driver into the {} Eg. Driver ={MySQL ODBC 3.51 Driver} If you are using windows you can check the exact name of you driver in the ODBC Admin section in Control panel. Nick |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Need help regarding the "Using MyODBC To Access Your MySQL Database Via ASP" article |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|