hi
i need to connect a vb application to a mysql database which is in a remote server
plz suggest solutions
thank u very much

Recommended Answers

All 14 Replies

hope this qould help you...please see the attached file.
you need an installer ODBC driver. this app uses mysql

Hello

if you are not familier to connectivity then directly use the oledb provider

Steps to create the udl file
1. create the blank notepad file ( do not entere anything and save it with mycon.udl on desktop or any other location)
2. close the notepad editor . U will find some new icon to the file currently u created
3. Double click on the mycon.udl file it will display u the same wizard as you get in the adodc control
4. Click on provider tab
5.Select Microsoft OLEDB Provider for sql server
6. Click on the next button
7. Enter the servername on which the sql server is installed
8 specify the user name and password if the sql server administrator has given to u or bydefault user name is sa and password is blank
9 select the database name

10 Click on the test button

11 click on Ok button

12 Right click on the mycon.udl file and open it with notepad

13 u will find some thing is generated
14 copy the text from provider till end

15 paste it in the vb
eg

dim con as adodb.connection

private sub form_load
con.connectionstring=[paste the copied text from provider]
con.open
your connection is ready

hope this help u

thank u for ur suggessions
as im a new programmer it will be very difficut to me to understand
so plz explain in detail
i need to connect to mysql database not to sql
thank u very much

Hello

if you are not familier to connectivity then directly use the oledb provider

Steps to create the udl file
1. create the blank notepad file ( do not entere anything and save it with mycon.udl on desktop or any other location)
2. close the notepad editor . U will find some new icon to the file currently u created
3. Double click on the mycon.udl file it will display u the same wizard as you get in the adodc control
4. Click on provider tab
5.Select Microsoft OLEDB Provider for sql server
6. Click on the next button
7. Enter the servername on which the sql server is installed
8 specify the user name and password if the sql server administrator has given to u or bydefault user name is sa and password is blank
9 select the database name

10 Click on the test button

11 click on Ok button

12 Right click on the mycon.udl file and open it with notepad

13 u will find some thing is generated
14 copy the text from provider till end

15 paste it in the vb
eg

dim con as adodb.connection

private sub form_load
con.connectionstring=[paste the copied text from provider]
con.open
your connection is ready

hope this help u

thanks a lot my friend i hope to share also my ideas soon

Thank you my friend.. you know this is my first time to participate in this type of forum..since i think all members are active..please do consider me as one of your students... i do hope to with my little knowledge i can help you soon.

i didnt open yet your sample but thanks...bro

Thank you my friend.. you know this is my first time to participate in this type of forum..since i think all members are active..please do consider me as one of your students... i do hope to with my little knowledge i can help you soon.

i didnt open yet your sample but thanks...bro

bro have you included the dbase and the password if ever there is?

I design a vb code + froms then i fail to connect with mysql database

I design a vb code + froms then i fail to connect with mysql database

r u trying to connect to the localhost or to a remote server
i know how to connect to the localhost
but when i tried to connect it to the remote server its not working and i finally found that

by default accessing mysql on the remote server is not allowed
we can change it but it was also not working

if u just want to know abt localhost may be i can help u

i want to connect it to localhost, plz help me!!

u can use the connection string

'MyODBC 3.51 Local database:
DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=myDatabase;USER=myUsername;PASSWORD=myPassword;OPTION=3;

before that u have to install the mysql odbc 3.51 driver

u can use this code

Dim rs As ADODB.Recordset
Dim adoconn As ADODB.Connection


Private Sub Form_Load()

Set adoconn = New ADODB.Connection

adoconn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=mca;UID=root;PWD=;OPTION=3;"

adoconn.Open

Set rs = New ADODB.Recordset

rs.ActiveConnection = adoconn

rs.LockType = adLockOptimistic

rs.CursorLocation = adUseClient

rs.CursorType = adOpenDynamic

rs.Open "SELECT name,adm_no FROM tbl_student_biodata where course_id='mca' and adm_no='" & Form1.Text1.Text & "' "

While Not rs.EOF


Text2.Text = rs!Name

'g = MsgBox("press ok", 1, "")

rs.MoveNext

Wend

End Sub

hello dear all i m new in programing inviroment i use ms access as client application and mysql as server application and the data that i enter is in fercian language(unicode) and looks like qustion marks (????????) plz help me to sove this problem
thanks
janafghan

hi there, i am new to mysql and i have a vb application and created a database in xampp. it wokrs fine when i access it using localhost but i don't have any idea how to access a database that is also created in xampp on a remote computer. please help me thankz.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.