Hi all..
Can anyone see what the problem is with this delete and insert command?
I'm using classic ASP and MS SQL.
Code:
ClientIDStrg =Request.QueryString("ClientIDStrg")
Code:
delete from RelatedProducts where ProductID=" & ProductID & "AND ClientID=" & ClientIDStrg & "or RelatedProductID=" & ProductID & "AND ClientID=" & ClientIDStrg
Code:
insert into RelatedProducts (ProductID,RelatedProductID,ClientID) values (" & ProductID & "," & arr(i) & "," & ClientIDStrg & ")"
If i use 1 inplace of the ClientIDStrg variable, all works fine.
The productID varailbe uses the same method and that works fine.
The database uses int for both fields.
The error i get is:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'or'.
Thanks in advance
Andy (scratching head)