Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access and ASP 1

Status
Not open for further replies.

shane01

IS-IT--Management
Apr 19, 2004
13
0
0
NZ
I've got an Access database which I'd like to make available on web server. I would like to create a drop down option on a web page to allow a user to pick which topic they'd like information on. The drop down menu contains the primary key of the table I'm querying. I would like to use a dsn less connection? Can anyone help me with regard to the ASP file and HTML file I need to use
 
this should get you started
all you need to do is add the DB name and tbl name plus the name of the rs to fill the select
<HTML>
<BODY>
<%
' declare variables
Dim Conn
Dim RS
Dim strConn

Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
'set path to DB dsn-less
strConn=&quot;Driver=Microsoft Access Driver (*.mdb); DBQ=&quot; & server.mappath(&quot;/database.mdb&quot;)& &quot;;&quot;
'sql statement
SQLstmt=&quot;SELECT * FROM tbl&quot;
Set RS = Server.CreateObject(&quot;ADODB.RecordSet&quot;)
conn.Open strConn
'
Set RS = Conn.Execute(SQLstmt)
%>

<FORM name=&quot;form1&quot;>

<SELECT NAME=&quot;sel1&quot;>

<%
Do While Not RS.EOF
Response.Write (&quot;<OPTION value='&quot; & RS(&quot;PARTDESCRIPTION&quot;) & &quot;'>&quot;)
Response.Write (&quot;</OPTION>&quot;)
rs.MoveNext
Loop
RS.Close
Set RS=Nothing
Conn.Close
Set Conn=Nothing
%>

</SELECT>
</FORM>
</BODY>
</HTML> I help at your own risk, if I brake it sorry! But if I fixed it, let me know with a
star.gif
[thumbsup2]
admin@onpntwebdesigns.com
 
Thanks jason, very appreciated! I help at your own risk, if I brake it sorry! But if I fixed it, let me know with a
star.gif
[thumbsup2]
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top