Question Locked

VB Excel Programmer

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to pass a variable to SQL using VB6 in Excel. What am I doing wrong? Code as follows:
Dim stri as String
stri = "12345"
"SELECT * "FROM TABLE" & Chr(13) & "" & Ch(10)& "WHERE (INV_TABLE.INVOICE_NUMBER='stri')")

Does not recognize 12345 in stri.

3 replies

by choppit

It's a long time since I've done anything in VB but check your use of quotes and parentheses.

This discussion is closed to new replies.