[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[3]: [cobalt-users] ASP and MYSQL



On Friday, February 21, 2003, 1:34:05 PM, you wrote:

>>
>>I had the same problem, and your code has helped solve my DNS
>>connection to the MySQL database.
>>
>>Is it possible to send me the continuation of the code to show me how to
>>execute queries on the database? The problem right now is I can no longer use
>>my_conn.execute (or something similar) to execute the query anymore. It's
>>giving me a runtime error.

BR> I just use some DreamweaverMX boilerplate

BR> (Note: connnMyConnection.asp has the connection string info, nothing else)

BR> <!--#include virtual="/Connections/connMyConnection.asp" -->

BR> <%
BR> set Recordset1 = Server.CreateObject("ADODB.Recordset")
BR> Recordset1.ActiveConnection = connMyConnection
BR> Recordset1.Source = "SELECT * FROM tablename"
BR> Recordset1.CursorType = 0
BR> Recordset1.CursorLocation = 2
BR> Recordset1.LockType = 3
BR> Recordset1.Open()
BR> Recordset1_numRows = 0
%>>

BR> Brian


Sorry for the delay on the update... here is what I found:

I suspect the root cause of the problem has not been eliminated
yet. I am making this assumption based on the following findings:

I followed the suggestion and modified my file with the following
code:

Dim connMyConnection 
connMyConnection = "Driver={MySQL}; SERVER=localhost; DATABASE=dbname;
UID=username; PASSWORD=password"
set Recordset1 = Server.CreateObject("ADODB.Recordset") 
Recordset1.ActiveConnection = connMyConnection 
Recordset1.Source = "SELECT * FROM main_content_entry" 
Recordset1.CursorType = 0 
Recordset1.CursorLocation = 2 
Recordset1.LockType = 3 
Recordset1.Open() 
Recordset1_numRows = 0 

Although earlier attempts to use DIM connMyConnection seems to
have fixed the root problem, once I have modified the file to
actually "load" the connection, the problem surface once again:

(Error found while loading the file)

ADODB.Recordset.1 error '80004005' 

SQLState: IM003 
Native Error Code: 80 
Specified driver could not be loaded 

/filename.asp, line 37

Line 37 is the following: 

Recordset1.ActiveConnection = connMyConnection 

So, in short, the original problem comes back. 

Very interesting... 

Any more ideas?
Ryan