Question:
mysql connection using vb6?
SAKTHI
2009-05-07 21:56:47 UTC
hi very good morning 2 all,

i have idea abt how to connect db(ms-access) thru vb but i want how to connect the mysql from vb. i have done code for this while running which show an error like "Microsoft[ODBC Driver Manager]DSN not found and no default driver specified"..how to proceed further.Pls help me..
Three answers:
Freddy
2009-05-10 00:56:42 UTC
1. Use ADODB: Project -> References -> Choose Microsoft ActiveX Data Objects Library (choose the newest version)



2. Define "Public dcon as ADODB.Connection" in a module, outside any subroutines or functions.



3. To connect to the database:



Set dcon = New ADODB.Connection



dcon.Open "DRIVER=MySQL ODBC 3.51 Driver;" _

& " SERVER=" & Hostname & ";" _

& " UID=" & Username & ";" _

& " PWD=" & Password & ";" _

& " DATABASE=" & Database & ";"



4. Hostname (e.g. localhost), Username, Password, Database are the parameters of the mysql database.



5. And then you can use a normal ADODB routines.
?
2016-10-20 12:41:21 UTC
rx.Open "elect *from subject", con, 3, 3 With rx .AddNew .Fields("membercode") = Text1.text textile .Fields("membername") = Text2.text textile .Fields("bookcode") = Text3.text textile .Fields("booktitle") = Text4.text textile .Fields("issuedate") = Text5.text textile .Fields("returndate") = Text6.text textile .replace end With MsgBox "records have been stored"
2009-05-07 21:59:20 UTC
xvxcvx


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...