select statement

blueducks
10-19-2004, 12:31 PM
hi
i m working in VB6 with a database created in MS Access

Set MyRecSetClient = MyConn.Execute("SELECT * FROM client WHERE clientID = '" & cID & "'")

cID is integer, clientID in the DB is 'number'

i m getting type mismatch, i know it gives me that error because it is treating cID as string, but i don't know how to fix it. how can i make it so it treats cID as integer??

00100b
10-19-2004, 12:59 PM
Remove the single-quotes.

MKoslof
10-19-2004, 06:40 PM
In addition, you should use the Recordset.Open method to execute a Select query. And you don't need the extra "&" since you are not concat. a string to your query declaration.



"SELECT * FROM client WHERE clientID =" & cID

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum