Question Inconsistent mySql connection error

cirno

Member
Joined
Nov 12, 2010
Messages
6
Programming Experience
Beginner
Hello, codegurus. Excuse me, but I need help.

I have been assigned to deploy a system that uses VB.Net and MySQL. After testing on 9 different PCs each on different regions, only 1 PC shows this error during deployment:

VB.NET:
System.ArgumentException: Formatof the initialization string does not conform to specification starting at index 22.
at System.Data.Common.DBConnectionString.GetKeyValuePair(Char[] connectionSting,Int32 currentPosition, String& key, Char[] valuebuf, Int32&vallength, Boolean&isempty)
at System.Data.Common.DBConnectionString.ParseInternal(Char[] connectionString, UdlSupport checkForUdl, NameValuePair & keychain)
at System.Data.Common.DBConnectionString..ctor(String ConnectionString ,UdlSupport check for Udl)
at System.Data.Common.DBConnectionString.ParseString(StringconnectionString)
at System.Data.Odbc.OdbcConnection.set_ConnectionString(String value)
at ProjectMembershipCounter.Module1.SyncTime()

What does that error means and what did I do wrong?

VB.NET:
Public Function SyncTime()
        Dim strSQL As String
        Dim drdate As OdbcDataReader
        Dim drtime As OdbcDataReader
        Dim conn As New OdbcConnection
        Dim curdate As Date

        Try
            strSQL = "SELECT NOW()"

            conn.ConnectionString = "Driver={MySQL ODBC 3.51 Driver}" & _
                                    ";SERVER=" & g_OUTLETSERVER & _
                                    ";PORT=" & g_DBPORT & _
                                    ";UID=" & g_DBUser & _
                                    ";PWD=" & g_DBPwd & _
                                    ";allow zero datetime=no"
            conn.Open()
            Dim rCmd As New OdbcCommand(strSQL, conn)
            drdate = rCmd.ExecuteReader()

            If drdate.Read Then
                curdate = CType(drdate.Item("now()"), Date)
            End If

            Dim st As SYSTEMTIME
            st.year = curdate.Year
            st.month = curdate.Month
            st.dayOfWeek = curdate.DayOfWeek
            st.day = curdate.Day
            st.hour = curdate.Hour
            st.minute = curdate.Minute
            st.second = curdate.Second
            st.milliseconds = curdate.Millisecond

            'Set the new time...
            SetLocalTime(st)

            conn.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
            conn.Close()
        End Try
    End Function

using ODBC connector v3.51.27 and MySQL essential-4.1.13a-win3

Help is needed and appreciated...thanks in advance.
 
Back
Top