It turned out that the ID that was returned from the source was null terminated and hence the quotation char could not be added.
Thanks for your responses.
User Profile
Collapse
-
Hi.
Thanks for replying.
Chr(39) adds the quotation (') before and after ID. I also tried the quotation strings directly like you've suggested and i get the same result.
I agree that the same code will not give different results on different PCs. But, isn't it a possibility that my dev PC has some dependencies satisfied that a piece of code works alright on my PC, and the other PC is missing those dependencies....Leave a comment:
-
srinathvs started a topic Run-time error 3075 - Syntax error in string in query expression VB6/MS-accessin Visual BasicRun-time error 3075 - Syntax error in string in query expression VB6/MS-access
Hi,
I have an access db that I am trying to query from a vb6 program. I've the following code:
Dim sSQLQuery As String
sSQLQuery = "SELECT * FROM TblData WHERE ID = " & Chr(39) & ID & Chr(39)
ID here is equal to 1234567890
MsgBox sSQLQuery
the msgbox says: SELECT * FROM TblData WHERE ID = '1234567890 Note that the quotation is missing at the end
...
No activity results to display
Show More
Leave a comment: