Hello, I have a current project that I'm working on that uses Access DBs to store data in. I actually completed the project, but the company wanted to add this function to the site, so if anyone can help, then I will succeed, if not, then..... Anyway, here is the problem. I have a db called customers that simply houses a customers "routing code" and a hyperlink to their login page (each customer has a different login page according to who they are). On the main page, I have a text box and a submit button that they can enter their company code in to and then ASP should(I hope) redirect them to the hyperlink that is stored in the db along with their code. Anyway, I have no idea where and how to do this. I suppose that we would use the response.redirect command, but putting this into action poses a challenge to me. If anyone could help, it would be greatly appreciated. Thank you in advance.
I have included my work so far listed below with some of the errors that I get.
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in string in query expression 'custcode = '1dc2'.
/pictures/redirectcustomer.asp, line 17
Here's the code(we needed to add a ' to it):
<%
'connection string
Dim objCONN
dim objRS
dim strSQL
dim strURL
Set objCONN=Server.CreateObject("ADODB.Connection"
objCONN.Provider ="Microsoft.Jet.OLEDB.4.0"
objCONN.Open "c:/db/pics/customers.mdb"
strSQL="SELECT url FROM tblcustomer WHERE custcode = '" & Request.Form("custcode"
set objRS=Server.CreateObject("ADODB.RecordSet"
objRS.Open strSQL,objCONN
strUrl=objRS("url"
set objRS=nothing
objCONN.Close
response.redirect(strUrl)
%>
we seem to be having a problem down at this line here "objRS.Open strSQL,objCONN"
I have included my work so far listed below with some of the errors that I get.
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in string in query expression 'custcode = '1dc2'.
/pictures/redirectcustomer.asp, line 17
Here's the code(we needed to add a ' to it):
<%
'connection string
Dim objCONN
dim objRS
dim strSQL
dim strURL
Set objCONN=Server.CreateObject("ADODB.Connection"
objCONN.Provider ="Microsoft.Jet.OLEDB.4.0"
objCONN.Open "c:/db/pics/customers.mdb"
strSQL="SELECT url FROM tblcustomer WHERE custcode = '" & Request.Form("custcode"
set objRS=Server.CreateObject("ADODB.RecordSet"
objRS.Open strSQL,objCONN
strUrl=objRS("url"
set objRS=nothing
objCONN.Close
response.redirect(strUrl)
%>
we seem to be having a problem down at this line here "objRS.Open strSQL,objCONN"