|
|
I know this is a long shot, but I'm having absolutely fuck all luck getting an answer to this anywhere else.
I'm trying to structure an SQL query in Visual Basic that looks at a specific table (NBoundRules) and compares the values held in its fields to those generated by my program. The statement currently looks like this:
"SELECT * From NBoundRules WHERE AVC4 = '" & sqlAVC4 & "' AND AVC5 = '" & sqlAVC5 & "' AND AVC8 = '" & sqlAVC8 & "' AND AVC9 = '" & sqlAVC9 & "' AND AVC10 = '" & sqlAVC10 & "' AND AVC11 = '" & sqlAVC11 & "';"
sqlAVC4, sqlAVC5 and so on are simply variables that the program passes values to when the query gets called.
The problem it's having is with all the ANDs. A value's getting passed to the first variable and it's checking the database table, but after that it's refusing to pass values to the others. I know that the only problem is with my syntax, but just can't see where it's wrong. Any help greatly appreciated, because I had exactly the same problem a couple of months back and had to take a more convoluted route to getting the database read, and I could do without having to go through all of that again. |
|
|