Solved

Mysql select statement with vbscript

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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