Solved

Mysql select statement with vbscript

Posted on 2006-12-01
3
1,477 Views
Last Modified: 2012-06-21
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
Comment
Question by:MKrauss
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 125 total points
ID: 18055613
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
 
LVL 1

Author Comment

by:MKrauss
ID: 18060612
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
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 18063332
Yes, this driver should compatible for latest mysql version 5.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now