I've created an asp page that allows the user to search for a company based on company name, number or city (using like). I then built a string using the criteria:
''''''''''''''''''''''''''''''''''''''''''''''''''''''
BuildString = "SELECT * FROM Customer WHERE " & buildstring & ";"
sqlstr = BuildString
<%
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open "test", "DSN=test;UID=;PWD="
Set RS = Conn.Execute (sqlstr)%>
''''''''''''''''''''''''''''''''''''''''''''''''''''''
I then display the results, and use the company number as a querystring to find out employees belonging to that company:
''''''''''''''''''''''''''''''''''''''''''''''''''''''
<a href="attendees.asp?customernumber=<%=RS("customernumber"
%>"><%=RS("CustomerName"
%></a>
''''''''''''''''''''''''''''''''''''''''''''''''''''''
On the next page I try to open another connection, but keep getting this error:
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.
Here is my code when I try and use the customernumber to display the employees (from another table):
''''''''''''''''''''''''''''''''''''''''''''''''''''''
<%
myVar2=Request.Querystring("customernumber"
BuildString2 = "SELECT * FROM attendee WHERE attendee.customernumber =" & "'" & myVar2 & "'" & ";"
sqlstr2 = BuildString2
%>
<%
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open "test", "DSN=test;UID=;PWD="
Set RS = Conn.Execute (sqlstr2)%>
''''''''''''''''''''''''''''''''''''''''''''''''''''''
What am I doing wrong?
''''''''''''''''''''''''''''''''''''''''''''''''''''''
BuildString = "SELECT * FROM Customer WHERE " & buildstring & ";"
sqlstr = BuildString
<%
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open "test", "DSN=test;UID=;PWD="
Set RS = Conn.Execute (sqlstr)%>
''''''''''''''''''''''''''''''''''''''''''''''''''''''
I then display the results, and use the company number as a querystring to find out employees belonging to that company:
''''''''''''''''''''''''''''''''''''''''''''''''''''''
<a href="attendees.asp?customernumber=<%=RS("customernumber"
''''''''''''''''''''''''''''''''''''''''''''''''''''''
On the next page I try to open another connection, but keep getting this error:
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.
Here is my code when I try and use the customernumber to display the employees (from another table):
''''''''''''''''''''''''''''''''''''''''''''''''''''''
<%
myVar2=Request.Querystring("customernumber"
BuildString2 = "SELECT * FROM attendee WHERE attendee.customernumber =" & "'" & myVar2 & "'" & ";"
sqlstr2 = BuildString2
%>
<%
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open "test", "DSN=test;UID=;PWD="
Set RS = Conn.Execute (sqlstr2)%>
''''''''''''''''''''''''''''''''''''''''''''''''''''''
What am I doing wrong?