T
Tracey
There's some problem in my parameters.add statement, but
I just don't know where. Can someone tell me ?
I tried to change the STR =? to STR = 'Australia', my
program worked.(There is a lot of tuples with country
= 'Australia' in the table.)
But the STR = ? did not work. I guess there might be
problems on the ODBCParameter part. But I don't know
where.
Dim MyConString As String = "DRIVER={MySQL ODBC 3.51
Driver};SERVER=localhost;DATABASE=litlinker;
UID=;PASSWORD=; OPTION=3"
Dim MyConnection1 As New OdbcConnection(MyConString)
Dim cmdStr as string
cmdStr = "SELECT Name, Country FROM Tab1 Join Tab2 on
Tab1.Name = Tab2.Name Where Country = 'Australia'"
Dim cmd As New OdbcCommand(cmdstr, MyConnection1)
cmd.Parameters.Add("CountryName", OdbcType.Char, 200)
Dim strCountry as string = 'Australia'
cmd.Parameters("CountryName").Value = StrCountry
Thanks a lot!
I just don't know where. Can someone tell me ?
I tried to change the STR =? to STR = 'Australia', my
program worked.(There is a lot of tuples with country
= 'Australia' in the table.)
But the STR = ? did not work. I guess there might be
problems on the ODBCParameter part. But I don't know
where.
Dim MyConString As String = "DRIVER={MySQL ODBC 3.51
Driver};SERVER=localhost;DATABASE=litlinker;
UID=;PASSWORD=; OPTION=3"
Dim MyConnection1 As New OdbcConnection(MyConString)
Dim cmdStr as string
cmdStr = "SELECT Name, Country FROM Tab1 Join Tab2 on
Tab1.Name = Tab2.Name Where Country = 'Australia'"
Dim cmd As New OdbcCommand(cmdstr, MyConnection1)
cmd.Parameters.Add("CountryName", OdbcType.Char, 200)
Dim strCountry as string = 'Australia'
cmd.Parameters("CountryName").Value = StrCountry
Thanks a lot!