Solved

Mysql select statement with vbscript

Posted on 2006-12-01
3
1,469 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

11 Experts available now in Live!

Get 1:1 Help Now