Hello,
The database I'm working with has these 2 fields:
- "CD", which stands for "Consolidated Design Number" (not Compact
DISC)
and
- "URL", which is the full URL (http://...)
Users need to be able to type a CD number into a form text box and,
upon submission, be redirected to a non-database-driven html index
(home page) for all the info associated with that paricular CD. A
drop-down might be simpler, but it would be way too long since there
are many, many numbers.
Here's what I have. Can't seem to get it to work.
Any assistance would be very much appreciated. Thanks!
<%
sDSN = "Driver={Microsoft Access Driver
(*.mdb)};Dbq=path-to-my-db.mdb;"
%>
<%
set ac = CreateObject("ADODB.Connection")
set ar = CreateObject("ADODB.Recordset")
ac.Open sDSN '"DSN=my-db","myuser","mypass"
sSQL = "SELECT URL FROM mytable WHERE CD=" & Request.Form("CD")
set ar = ac.Execute(sSQL)
if NOT ar.EOF then
URL = ar("URL")
Response.Redirect url
else
' new customer or bad ID
End If
%>