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

0
edit delete
are you sure?
asked Jean-Marc CADIOU

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 :(

0
edit delete
are you sure?
answered Krzysztof Spaliński

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

0
edit delete
are you sure?
answered Jean-Marc CADIOU

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 :)

0
edit delete
are you sure?
answered Krzysztof Spaliński

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

0
edit delete
are you sure?
answered Jean-Marc CADIOU

Post an answer but please log in first

Post Answer
  1. Please log in to post answer

Similar Questions

Tagsfor this question

Forumall questions