BARBELITH underground
 

Subcultural engagement for the 21st Century...
Barbelith is a new kind of community (find out more)...
You can login or register.


SQL question for programming spods

 
 
Spatula Clarke
21:33 / 13.03.03
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.
 
 
w1rebaby
00:46 / 16.03.03
I want to bump this because... I don't know. I don't even know the answer. I try to avoid SQL as much as possible because it's too tempting to do everything in one big block of code that nobody else understands a badger's-worth of, and so can't fix when it goes wrong, which is good from a corporate sabotage point of view but there are better ways, like my patented "remove all formatting and comments" script.

Sorry. But I'm bumping it anyway.
 
 
The Puck
00:55 / 16.03.03
he hehe you speak funny
 
  
Add Your Reply