Lost connection to MySQL Server during query

Private Sub Class_Initialize()
' On Error GoTo ERR_HANDLER
DoEvents
'/// for remote server
Set mySQLCn = New ADODB.Connection
With mySQLCn
.connectionString = "Driver={MySQL ODBC 3.51 Driver};" _
& " Server=192.168.1.160;" _
& " Port=3306;" _
& " Database=inventorymain;" _
& " User=root;" _
& " Password=;" _
& " Option=3;"
.CursorLocation = adUseClient
.Open
End With
IsConnected = True
MsgBox "The Connection is Established Successfully.", vbInformation + vbOKOnly
Exit Sub
ERR_HANDLER:
MsgBox "Cannot connect to the server Please try again.", vbCritical + vbOKOnly
IsConnected = False
End Sub
'// the above code shows error :"Lost connection to MySQL Server during query"
The above code executes properly while replacing the ip address with localhost. When I run the ip address from a remote computer browser, the phpmyadmin runs in all computers within the network/LAN and allows to add/edit/delete records from the database.

VERY MUCH CONFUSED. IF PHPMYADMIN IS accessable from remote computer, why it is not connecting with the MySQL ODBC 3.51 Driver ??? Any Help Please ????

0 answers