Solved

Mysql select statement with vbscript

Posted on 2006-12-01
3
1,518 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 52

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 52

Expert Comment

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

737 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