Connect a VbScript to MySQL without ODBC driver

Hi everybody,

I'm just beginning with MySQL and I try to make a connection between a VBscript and a MySQL Database.

I just want to know if there is a way to make a connection to a database using ADODB and WITHOUT using an ODBC driver ?? I tried many connection string without success !

If so have an experience to share that would be amazing !

Thanks

4 answers

Hello Jean,

my exemple vbscript :

------------[Exemple.vbs]----------------------

Set connection = CreateObject("ADODB.Connection")
CNN = "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=myDataBase;User=myUsername;Password=myPassword;Option=3;"
SQL1="SELECT C.[Id_Crew] ,C.[Crew_name]  FROM [Crew] C"
connection.open CNN
Set RS=connection.execute(SQL1)
Do while not RS.EOF
   msgbox CSTR(RS.fields(0).value)+" "+CSTR(RS.fields(1).value)
   RS.movenext
loop
RS.Close
connection.close

---------------end of file--------------------------------------

Unfortunately i haven't experience without ODBC Driver :(

Hi Krzysztof

First of all thanks for your post
In your code Driver ={MySQL ODBC .... means that your Database connection use the ODBC driver ?!
I’ m looking for a way to connect MySQL database without installing Odbc Driver !?
Perhaps I don’t understand the way ADO works ?!

What is your opinion ?

Thanks

Hi,
Jean i apologize you for so trivial answer. Yes, you have right - this solution needs install driver. At this moment don't know others ways. You are using vbscript, so that means you work on windows, as i know (perhaps i'm wrong) there is no way without driver on vbscript.

Good luck with searching solution :)

Hi Krzysztof

Yes I work on a windows machine
You’re right there is no way to connect without an ODBC
driver ... what I did !!
PIty that MySQL doesn’t install it during the setup !

Thanks for your help and your time

Regards
JMarc