Hi
I`m using VB 6.0 for making a mysql query (ADO connection) with LIKE operator and the wildcard %, But I don´t know what is the correct syntax, I've got a Mysql table called codes with numbers and each number has an ID, I want to match the mysql numbers with a varibale called Numberx, for example:
Numberx is: 5856561
and the codes table has the following fields:
code Id
5856 100
5857 101
5858 102
108 103
109 104
Numberx matches with number (code) 5856 and its ID is: 100, I'm trying to use VB mysql wildcard "%" for I dont know the correct syntax.
This is my VB code:
Does somebody know a web page with VB 6.0 intructions for mysql
Thanks!!
I`m using VB 6.0 for making a mysql query (ADO connection) with LIKE operator and the wildcard %, But I don´t know what is the correct syntax, I've got a Mysql table called codes with numbers and each number has an ID, I want to match the mysql numbers with a varibale called Numberx, for example:
Numberx is: 5856561
and the codes table has the following fields:
code Id
5856 100
5857 101
5858 102
108 103
109 104
Numberx matches with number (code) 5856 and its ID is: 100, I'm trying to use VB mysql wildcard "%" for I dont know the correct syntax.
This is my VB code:
Code:
Numberx = Mid(Number, 1, 3)
Set Rs1 = Cnx.Execute("select COUNT(*) as count from codes where code LIKE " & Numberx) 'I'm know how to put wildcard %
countdr = Rs1.Fields("count")
If countdr <> 0 Then
IdNum = Cnx.Execute("select * from codes where code=" & Numberx).Fields("Id")
End If
Does somebody know a web page with VB 6.0 intructions for mysql
Thanks!!