Hi guys. the following is my customer_table structure & data:
CID
Username
Password
Name
10515
stephen
12345
Happy Stephen
Everything is working fine until I changed to [MySQL ODBC 5.3 Unicode Driver]
Returned Result of using 3.51 (working fine)
10515, Happy Stephen
Returned Result of using 5.3 (incorrect. CID displayed [0] instead of [10515])
0, Happy Stephen
below is my code to validate customer login (stephen, 12345)
Public Function login(ByVal action As String, ByVal username As String, ByVal password As String) As DataTable
Dim ConnStr As String = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=mydatabase;UID=root;PASSWORD=@993272;Charset=UTF8;OPTION=3;"
Dim MyConn As New OdbcConnection(ConnStr)
Dim mydataadapter As OdbcDataAdapter
Dim mydatatable As DataTable
If action = "login" Then
Str = "SELECT * FROM customer_table WHERE username=? AND password=? AND status = 'Active'"
End If
Try
mydataadapter = New OdbcDataAdapter(Str, MyConn)
mydataadapter.SelectCommand.Parameters.AddWithValue("", username)
mydataadapter.SelectCommand.Parameters.AddWithValue("", password)
mydatatable = New DataTable
mydataadapter.Fill(mydatatable)
Catch ex As Exception
errormsg = ex.Message
logfile(Str, errormsg)
End Try
If Not MyConn Is Nothing Then
MyConn.Close()
End If
Return mydatatable
End Function
Member
103 Points
794 Posts
Weird case while using [MySQL ODBC 5.3 Unicode Driver]
Jun 08, 2020 04:45 PM|kengkit|LINK
Hi guys. the following is my customer_table structure & data:
Everything is working fine until I changed to [MySQL ODBC 5.3 Unicode Driver]
Returned Result of using 3.51 (working fine)
10515, Happy Stephen
Returned Result of using 5.3 (incorrect. CID displayed [0] instead of [10515])
0, Happy Stephen
below is my code to validate customer login (stephen, 12345)
All-Star
53121 Points
23672 Posts
Re: Weird case while using [MySQL ODBC 5.3 Unicode Driver]
Jun 08, 2020 06:35 PM|mgebhard|LINK
There can be many reasons. Have you done any research on the driver? Breaking changes?
How are you testing? Is the code above everything needed to reproduce this issue? Should we assume CID is an integer?
Member
103 Points
794 Posts
Re: Weird case while using [MySQL ODBC 5.3 Unicode Driver]
Jun 09, 2020 03:09 AM|kengkit|LINK
Hi. I have go through the following url but no clues for my problem:
https://downloads.mysql.com/docs/connector-odbc-relnotes-en.a4.pdf
Yes. Code provided is everything needed to reproduce the issue. CID is an integer (auto increment)