Hi guys.! Good day!

I have a one windows xp computer which ive installed wamp(windows apache mysql) package. I want to connect to this computer using one computer on a network. The code works fine when i run the program on this server computer because i will just specify the server name to "localhost".But when i run the program to another computer and replace localhost with the name of the computer which the mysql server installed, it will returned error. My code below(pls correct).

Public datasourcepath, usernamelog, passwordlog, databasenamelog As String


Sub ConnServer()

'servername ="\\ADMINSERVER" where mysql is installed
datasourcepath = servername
usernamelog = "admin"
passwordlog = "enaonline"
databasenamelog = "enamysqldb"
db_port = ""

constr = "Provider=MSDASQL.1;Password=;Persist Security Info=True;User ID=;Extended Properties=" & Chr$(34) & "DRIVER={MySQL ODBC 3.51 Driver};DESC=;DATABASE=" & databasenamelog & ";SERVER=" & datasourcepath & ";UID=" & usernamelog & ";PASSWORD=" & passwordlog & ";PORT=" & db_port & ";OPTION=16387;STMT=;" & Chr$(34)
Set conn = New ADODB.Connection
conn.Open constr

Pls help..

Thank you and God bless on this mpther earth.
Exit Sub

Recommended Answers

All 2 Replies

Your mysql in other machine is configured to listen on 127.0.0.1 port.

Even if it is configured to listen to all connection it still gets an error. Howeve, can i use the ip address of the server instead of its name.?

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.