• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1599
  • Last Modified:

Mysql select statement with vbscript

Hi,
i'm using vbscript and would like to know how i could do the following ado statement to a mysql
server:

'used on a ms sql:
Set objDBConnection = CreateObject("ADODB.Connection")
sConnectionString  = "Provider=SQLOLEDB; Data Source=" & sSQLServer & "; Initial Catalog=" & sCatalog & "; User Id=user; Password=pass"
objDBConnection.Open sConnectionString
Set objRs = objDBConnection.Execute("SELECT field FROM table order by arg")
objRs.movefirst
Do While Not objRs.EOF
  .....
  objRs.movenext
 loop

Many thanks
Matt.
 
0
MKrauss
Asked:
MKrauss
  • 2
1 Solution
 
Ryan ChongCommented:
try change the connectionstring to something like:

sConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=serverName;DATABASE=schemaName;USER=userName;PASSWORD=password"            

You may download this driver from mysql site at:
http://dev.mysql.com/downloads/connector/odbc/3.51.html

More reference:
http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForMySQL

Hope this helps
0
 
MKraussAuthor Commented:
thanks, i came already to this stage but didnt had success before, somehow that works
only for me if i follow in detail your given sample from
http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForMySQL
including all the options, guess that was the problem.

One more thing, will this work with the latest mysql version 5 as well ?

0
 
Ryan ChongCommented:
Yes, this driver should compatible for latest mysql version 5.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now