473,394 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

VB6 and MYSQL Connection

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
5 5207
lotus18
866 512MB
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
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
8,127 Expert 4TB
You need to specify the server name / ip address in the connection string.
Apr 15 '08 #4
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
8,127 Expert 4TB
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

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

Similar topics

1
by: Luke Wojtow | last post by:
Hi all, http://bugs.mysql.com/bug.php?id=3779 Discussion about insecurity of mysql_pconnect in multi-server/multi-user environment.Can anyone explain what Hartmut Holzgraefe meant by "But even...
0
by: DH | last post by:
I must work with phpMyAdmin 2.6.0-pl3 installed on a client's Windows NT web server. I've not previously encountered options for charset and collation using phpMyAdmin, and am not sure what to set...
0
by: Peter Höltschi | last post by:
I try to install MySQL Connection/J on a Windows XP box. MySQL on localhost works fine. But I cannot load the MySQL Connection/J Driver. The CLASSPATH variable is set like this:...
4
by: obmij | last post by:
Hi all, I am a WAMP newbie and would appreciate your help! I have installed Apache 2.2.4, Mysql 5 and PHP 5 have got them all up and running and tested them separately, I was able to do the...
3
by: tulika dutta | last post by:
after 8 hrs my MySQL connection with JDBC gets time out. It gives the error java.sql.SQLException: No operations allowed after connection closed.Connection was implicitly closed due to underlying...
13
by: tommurray | last post by:
Hi all I am new to php and i need a little help, I have a webpage which is going to draw all the content from a database were the user can login and amend the values of the field. Within the...
1
by: priya19 | last post by:
Warning: open(/tmp\sess_b609ea08fa1da72b0daef1233c822e7b, O_RDWR) failed: m (2) in C:\apache\htdocs\cmi\quick_find.php on line 2 Warning: MySQL Connection Failed: Can't connect to MySQL server on...
1
by: lakshmipurna | last post by:
Is there any record set in mysql connection to asp.net with c# code
0
by: abhighat4214 | last post by:
Hello All, Actually I wanted to implement a MySQL connection time-out for the data-entry application which I developed in PHP. I just wanted to know is there any function in PHP-MYSQL lib that...
6
by: Matt Rose | last post by:
Update a MYSQL db password using crypt() technology on MYSQL connection. I am looking to update a user table of passwords that were inserted without using crypt() on a Perl development project. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.