Question

I have a small application that runs on a DataLoxxxgic PDA Scanner on Windows Mobile 6.5. My application scans serials numbers and then uploads them to a MySQL Database. I am using Microsoft Visual Studio 2008 and MySQL.Data.CF ver. 6.7.4.0.

2 days ago I could connect perfectly and insert records to MySQL Database no problems. Since yesterday I keep on getting a Unable to connect to any of the specified MySQL Hosts.

I want to mention that there is; 1) NO Firewall blocking 2) I have tried older versions of MySQLData.CF. 3) Check the MySQL Database as all info supplied is correct.

connections string as follows:

    Imports System.Data
    Imports MySql.Data.MySqlClient

    Dim cnnMySQL_Main As MySql.Data.MySqlClient.MySqlConnection
    Dim sConnectionString As String

    sConnectionString = "Server=xxx.xxx.xxx.xxx;"
    sConnectionString = sConnectionString & "Uid=xxxxx;"
    sConnectionString = sConnectionString & "Pwd=xxxxxx;"
    sConnectionString = sConnectionString & "Database=xxxxx;"
    sConnectionString = sConnectionString & "default command timeout=20;"
    sConnectionString = sConnectionString & "Allow Zero Datetime=true"



    'sConnectionString = String.Format("port=3306;server={0};user id={1}; password={2}; database=xxxxxxx; pooling=false", "server=xxx.xxx.xxx.xxx", "xxxxxxx", "xxxxxx")

    cnnMySQL_Main = New MySql.Data.MySqlClient.MySqlConnection(sConnectionString)


    Try


        If cnnMySQL_Main.State = Data.ConnectionState.Closed Then
            cnnMySQL_Main.Open()
            ConnectMySQLDB_main = True
        Else
        End If

    Catch ex As Exception
        MsgBox("Connection Error :  " & ex.Message)
        ConnectMySQLDB_main = False
    Finally
        'ConnectMySQLDB_main = True
    End Try

I have tried various options but no luck.

Can anyone assist?

Thanks

Was it helpful?

Solution

I fixed the issue. rather straight forward. I had the USB Cable plugged in with Active Synch running. The second that I unplugged this cable I could connect perfectly!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top