Click to See Complete Forum and Search --> : Help with Error Message


screaming_banjo
12-07-2004, 08:38 AM
I have this

<% Set rsSelDept = Server.CreateObject("ADODB.Recordset")
rsSelDept.Open "SELECT * FROM tblmorDept where mordeptID= " & request("DeptID") & "", conn, adOpenKeyset, adLockReadOnly %>

I get this error:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near '='.

/itSupportDeptOverview.asp, line 114

Line 114 is the line above that begins <% Set rsSelDept etc....

I have no idea why it says there is an error on line 1, it's an include and I use it on all my pages.

Any help would be most appreciated!

Thanks

jifang74
12-07-2004, 12:35 PM
What is the include line?

1. Check to make sure that the included file is the correct folder.
2. Check to make sure that the file being included doesn't have any errors in it.

russell
12-07-2004, 01:34 PM
almost certainly request("DeptID") is empty. Response.Write the value of request("DeptID")

screaming_banjo
12-08-2004, 05:03 AM
Hi

Thanks, I got there! DeptID was empty.