gibby
12-02-2002, 06:38 PM
ive coded my site in jscript asp. Ive got a sql statement that should have no problems the statement that ive got is.....
oRecordSet = oConnection.Execute( "SELECT Title FROM News WHERE newsID =\"" + Nid + "\"")
I get error above when I try and run the script. If I exchange the variable Nid for a number the statement will work. The variable Nid stands for News ID and contains a numeric value. I know it contains a numeric value because I used it in a sum and it came out with the correct answer. If it was a string it would have added it on to the end of the string. And I also tried it with the IsFinite method and it didn’t return a false value.
I used exactly the same syntax in all my other sql statements and I have'nt had a problem with any of those so I’m a bit puzzled. Any help would be appreciated. Thanks
oRecordSet = oConnection.Execute( "SELECT Title FROM News WHERE newsID =\"" + Nid + "\"")
I get error above when I try and run the script. If I exchange the variable Nid for a number the statement will work. The variable Nid stands for News ID and contains a numeric value. I know it contains a numeric value because I used it in a sum and it came out with the correct answer. If it was a string it would have added it on to the end of the string. And I also tried it with the IsFinite method and it didn’t return a false value.
I used exactly the same syntax in all my other sql statements and I have'nt had a problem with any of those so I’m a bit puzzled. Any help would be appreciated. Thanks