notification = Request.Form("notification")notification1 = Request.QueryString("notification")
This works when submitting from a form
sSQL="SELECT top 1 * FROM [Data_Test].[dbo].[Table1],[Data_Test].[dbo].[Table2] where notification = '" & notification & "' and [Data_test].[dbo].[Table2].notification_number = notification"
This works submitting from a url as lookup.asp?notification=545455656
sSQL="SELECT top 1 * FROM [Data_Test].[dbo].[Table1],[Data_Test].[dbo].[Table2] where notification = '" & notification1 & "' and [Data_test].[dbo].[Table2].notification_number = notification"
This does not work with the or, if I use real numbers and test in SQL, it works fine.
sSQL="SELECT top 1 * FROM [Data_Test].[dbo].[Table1],[Data_Test].[dbo].[Table2] where (notification = '" & notification & "' or notification = '" & notification1 & "') and [Data_test].[dbo].[Table2].notification_number = notification"
Does anybody know why this would be? With the or, it fails submitting from the form and from a URL request string.
I get the following error:
Microsoft OLE DB Provider for SQL Server error '80040e07'
Error converting data type varchar to numeric.