By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

VB6 and MYSQL Connection

P: 19
Hi there VB6 master i have a question, how can i access my mysql database in vb6... am not very familiar inmysql that's why i dont know how to start... i have using vb6 & access for all my programming work, but now i decided to shift to a higher level of programming, can you give some step by step procedure on how i can achieve to access my mysql database in vb6...

I have successfully created a mysql database, and created table fields and insert some data's on it... but i dont know how to access the database...

can somebody give some sample code on how to connect or access my mysql database or direct me on some website where i can read some points...

by d way am using mysql server version 4.1...


thank you so much ... sorry if i dont have sample codes for it, because i dont know how to start.. hoping that someone here can help me...
Apr 15 '08 #1
Share this Question
Share on Google+
5 Replies


lotus18
100+
P: 866
Hi there VB6 master i have a question, how can i access my mysql database in vb6... am not very familiar inmysql that's why i dont know how to start... i have using vb6 & access for all my programming work, but now i decided to shift to a higher level of programming, can you give some step by step procedure on how i can achieve to access my mysql database in vb6...

I have successfully created a mysql database, and created table fields and insert some data's on it... but i dont know how to access the database...

can somebody give some sample code on how to connect or access my mysql database or direct me on some website where i can read some points...

by d way am using mysql server version 4.1...


thank you so much ... sorry if i dont have sample codes for it, because i dont know how to start.. hoping that someone here can help me...
So how do you connect your access to vb6? make some changes there.

Rey Sean
Apr 15 '08 #2

P: 19
hey! i've finally achieve what i want to do, i was able to connect my mysql database in my vb6 progam

To share heres my code:

Expand|Select|Wrap|Line Numbers
  1.   Set conn = New ADODB.Connection
  2.   conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
  3.                         & "SERVER=localhost;" _
  4.                         & "PORT=3306;" _
  5.                         & "DATABASE=user;" _
  6.                         & "UID=;PWD=; OPTION=3;" _
  7.                         & "STMT=;"
  8.  
  9.   conn.Open
  10.  
  11.   Set rs = New ADODB.Recordset
  12.   rs.CursorLocation = adUseServer
  13.  
Now i have a different story, i have a mysql database running on a linux server... its an online registration, now what i have to do is to access my mysql database on my linux based server.. is it possible? hitch me some hints....

Thanks
Apr 15 '08 #3

debasisdas
Expert 5K+
P: 8,127
You need to specify the server name / ip address in the connection string.
Apr 15 '08 #4

P: 29
You need to specify the server name / ip address in the connection string.
sorry,i really want to know,cause this discussion related what i do now.
i was make my connection like this....
[VB]
Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=srv7.890m.com;PORT=3306;DATABASE=database; UID=a2840013_guest;" _
& "PWD=mypass; OPTION=3;STMT=;"
conn.Open
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseServer
[VB]
but i cant connect it...it say access denied for user a2840013_guest@222.194.99.242(using passoword:Yes)
the 222.194.99.242 is my ip...... not the webserver...
im sure that my password and user name is right....
what i must to do?
thank you.....
Apr 17 '08 #5

debasisdas
Expert 5K+
P: 8,127
There is some access issue. You need to contact your sys admin and get the desired permission granted. You have to pass server username / password and database uername / password.
Apr 17 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.