|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have just installed MySql to use with ASP and I've been having start-up problems - mostly due to lack of experience!
I followed the devarticles article about using my odbc to Access MySql Database via ASP. This is the ASP code I am running... <% 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=mysql_dsn" adoRS.ActiveConnection = adoConn if adoConn.errors.count = 0 then response.write "<h2>Fields In The 'Contacts' Table:</h2>" adoRS.Open "describe contacts" 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 error message stated at the end is coming up but I have no idea why or how to fix it. I have tried this code using both a DSN connection and a DSN-Less connection with the same results. Please help! I think everything is ok from the database side of things. Last edited by jenpenod : December 16th, 2002 at 05:36 PM. |
|
#2
|
|||
|
|||
|
Hey Man. I have the same problem
I have the same Problem and I haven't solved it yet.
The funny thing is that I worked once but most of the time it returns the error. This is what I posted: I installed the MYSQL ODBC 3.51 and I've used my Mysql database with Visual Basic programming for quite some time now, and it works great. But now I have to develop a webpage in ASP. There seems to be a problem with the connection string: connection.Open "PROVIDER=MSDASQL;driver={MySQL ODBC 3.51 Driver};server=localhost;uid=user;pwd=password;dat abase=mydb;" The thing is that this String has worked once or twice and most of the time it doesn't, while the DSN and the database connection in Visual Basic always works. I have never changed the string, I've used other strings, like the one I read in the whole "Using MyODBC To Access Your MySQL Database Via ASP" article By: Annette Tennison, but still it gives me this error: Can't find the database source or didn't specify the default driver I thought that maybe the application "WinMySqladmin Ver 1.4" that comes with the Mysql installation waas the problem, but the problem happens WITH the application running and WITHOUT it. Many people respond telling me to check the connection string, but I have done that already 1000 times, and it is right, I believe there is a configuration problem with my IIS or the Mysql ODBC. PLEASE. IF YOU FIND THE SOLUTION. RESPOND IT IN THIS FORUM PLEASE |
|
#3
|
|||
|
|||
|
Trying to use VB to connection to MYSQL DB
Does anyone have sample code in Visual Basic on how to connect to a MYSQL database and return or bring back records?
I used Sybase connections before but never MYSQL. Thanks. |
|
#4
|
|||
|
|||
|
Has anyone found a solution to condealmasy's problem? I'm experiencing the same thing.
|
|
#5
|
|||
|
|||
|
My Fix
I was having the same problem until just now - I used the code provided by condealmasy:
connection.Open "PROVIDER=MSDASQL;driver={MySQL ODBC 3.51 Driver};server=localhost;uid=;pwd=;database=myDB;" And it was spitting out the same errors. I searched on URL for a fix and found that after installing MyODBC 3.51x driver, the code above worked flawlessly. The URL for the dirver can be found at: URL I hope it works for you all as well! Good luck! ![]() Last edited by tyler : August 10th, 2003 at 05:12 PM. |
|
#6
|
|||
|
|||
|
SOLUTION
A nice Tech from MySQL AB sent me this solution to this:
"This is a known issue, and you can cross check this from Microsoft KB article 306345 on how to resolve this." This returned 2 articles in my search. They will resolve your issue. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Error Connecting to Database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|