Hi All,
I am new to MySQL and I'm stumbling along trying to figure things out. I have been able to connect to the data source via Access and some other 3rd party tools. I've added tables and manipulated the data. However, when I try to access the same tables via an ASP script I keep getting OLE DB errors. Could someone please send me a proper ADO connection example for inserting a record? My script was working fine when I was using it with the Access DB. I copied the same structure to mySQL and tried to use the following connection code:
Here is the code:
---------------------------------------------------------
Set rst1=Server.CreateObject("ADODB.RecordSet"
Set db_conn=Server.CreateObject("ADODB.Connection"
db_conn = "Driver={MySQL};Server=localhost;DATABASE=mydb;UID=user;PWD=password;"
rst1.Open "mytable", db_conn, adOpenKeySet, adLockPessimistic, adCmdTable
rst1.addnew
rst1("IP_Add" = Request.ServerVariables("REMOTE_HOST"
blah blah blah
----------------------------------------------------------
This last line:
rst1("IP_Add" = Request.ServerVariables("REMOTE_HOST"
is the line that gives me the following error:
-----------------------------
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
-----------------------------
I also tried remarking all fo the ServerVariable request out and tried just using the data that is being submitted from a form. Same results.
The only field that I did not get an error on was:
rst1("Timestamp" = Now
This puzzles me extremely.
Your help is greatly appreciated!
WaltD
WaltD@tampabay.rr.com
I am new to MySQL and I'm stumbling along trying to figure things out. I have been able to connect to the data source via Access and some other 3rd party tools. I've added tables and manipulated the data. However, when I try to access the same tables via an ASP script I keep getting OLE DB errors. Could someone please send me a proper ADO connection example for inserting a record? My script was working fine when I was using it with the Access DB. I copied the same structure to mySQL and tried to use the following connection code:
Here is the code:
---------------------------------------------------------
Set rst1=Server.CreateObject("ADODB.RecordSet"
Set db_conn=Server.CreateObject("ADODB.Connection"
db_conn = "Driver={MySQL};Server=localhost;DATABASE=mydb;UID=user;PWD=password;"
rst1.Open "mytable", db_conn, adOpenKeySet, adLockPessimistic, adCmdTable
rst1.addnew
rst1("IP_Add" = Request.ServerVariables("REMOTE_HOST"
blah blah blah
----------------------------------------------------------
This last line:
rst1("IP_Add" = Request.ServerVariables("REMOTE_HOST"
is the line that gives me the following error:
-----------------------------
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
-----------------------------
I also tried remarking all fo the ServerVariable request out and tried just using the data that is being submitted from a form. Same results.
The only field that I did not get an error on was:
rst1("Timestamp" = Now
This puzzles me extremely.
Your help is greatly appreciated!
WaltD
WaltD@tampabay.rr.com