MySQL Connection String?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top