R
Rob Meade
Lo all,
Little bit puzzled, I have a connection string that I usually use for my
apps, has worked up until now quite happily.
I've changed it slightly to work with the MySQL database I am now having to
connect to.
objConnection.Open "DRIVER={MySQL ODBC 3.51 Driver}; UID=<user>;
PASSWORD=<password>; DATABASE=<database>; SERVER=<ip>"
Set objCommand = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject("ADODB.Recordset")
objCommand.CommandText = SQL
objCommand.CommandType = adCmdText
Set objCommand.ActiveConnection = objConnection
'RS.Open objCommand,,adOpenKeySet, adLockOptimistic
Set RS = objConnection.Execute("SELECT <column1>, <column2> FROM <table>"
In the above I'd usually use the commented line, but I got errors with it,
so I checked a VERY old connection I used to use on another MySQL database,
and paste in the last line - this now works....
Whilst I'm happy to sit back and enjoy it working I was wondering why the
original one doesn't...
Is there another way rather than doing connection.execute to do the same
thing?
Thanks in advance for any help.
Regards
Rob
Little bit puzzled, I have a connection string that I usually use for my
apps, has worked up until now quite happily.
I've changed it slightly to work with the MySQL database I am now having to
connect to.
objConnection.Open "DRIVER={MySQL ODBC 3.51 Driver}; UID=<user>;
PASSWORD=<password>; DATABASE=<database>; SERVER=<ip>"
Set objCommand = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject("ADODB.Recordset")
objCommand.CommandText = SQL
objCommand.CommandType = adCmdText
Set objCommand.ActiveConnection = objConnection
'RS.Open objCommand,,adOpenKeySet, adLockOptimistic
Set RS = objConnection.Execute("SELECT <column1>, <column2> FROM <table>"
In the above I'd usually use the commented line, but I got errors with it,
so I checked a VERY old connection I used to use on another MySQL database,
and paste in the last line - this now works....
Whilst I'm happy to sit back and enjoy it working I was wondering why the
original one doesn't...
Is there another way rather than doing connection.execute to do the same
thing?
Thanks in advance for any help.
Regards
Rob