Please help.
I have an Access97 database with a table called tblSystems and fields called SystemID, Name, Date, etc.
How can i make a web page with a combo box showing all the system ids from the table?
Then, selecting a system id will show the user the information for that system id. (such as Name, Date, etc.)
Hui (another tek-tipper)has been trying to help me, but it is not working. And his code has the options hardcoded.
In his example, we are assuming a database with 5 different tables (car, boat, star, house and computer). but i am getting errors.
please help!!
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type"
<TITLE>Query1</TITLE>
<BODY>
<FORM METHOD="Post" ACTION="Test.ASP">
<SELECT name="type" class='box1'>
<OPTION value='1'>Car</OPTION>
<OPTION value='2'>Boat</OPTION>
<OPTION value='3'>Star</OPTION>
<OPTION value='4'>House</OPTION>
<OPTION value='5'>Computer</OPTION>
</SELECT>
<INPUT TYPE="Submit" VALUE="Run Query">
</FORM>
</BODY>
</HTML>
and this is my test.asp:
<% @Language=VBScript %>
<html>
<head>
<title>test</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<% type=Request.Form("type"
'Connects to the Access driver and Access database in the Inetpub directory where the database is saved
strProvider = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=E:\Inetpub\'Creates an instance of an Active Server component
set objConn = server.createobject("ADODB.Connection"
'Opens the connection to the data store
objConn.Open strProvider
'Instantiate Command object and use ActiveConnection property to
'attach connection to Command object
set cm = Server.CreateObject("ADODB.Command"
cm.ActiveConnection = objConn
if (type = 1) then
sqltext = "SELECT * FROM Car"
elseif (type = 2) then
sqltext = "SELECT * FROM Boat"
elseif (type = 3) then
sqltext = "SELECT * FROM Star"
elseif (type = 4) then
sqltext = "SELECT * FROM House"
elseif (type = 5) then
sqltext = "SELECT * FROM Computer"
end if
'set cnn = Server.CreateObject("ADODB.Connection"
'cnn.Open "driver={Microsoft Access Driver (*.mdb)};;DBQ=E:\Inetpub\set Results= cnn.Execute(sqltext)
do until Results.eof
Response.Write(Results("Cost")
Results.movenext
loop
%>
</form>
</body>
</html> ruth.jonkman@wcom.com
I have an Access97 database with a table called tblSystems and fields called SystemID, Name, Date, etc.
How can i make a web page with a combo box showing all the system ids from the table?
Then, selecting a system id will show the user the information for that system id. (such as Name, Date, etc.)
Hui (another tek-tipper)has been trying to help me, but it is not working. And his code has the options hardcoded.
In his example, we are assuming a database with 5 different tables (car, boat, star, house and computer). but i am getting errors.
please help!!
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type"
<TITLE>Query1</TITLE>
<BODY>
<FORM METHOD="Post" ACTION="Test.ASP">
<SELECT name="type" class='box1'>
<OPTION value='1'>Car</OPTION>
<OPTION value='2'>Boat</OPTION>
<OPTION value='3'>Star</OPTION>
<OPTION value='4'>House</OPTION>
<OPTION value='5'>Computer</OPTION>
</SELECT>
<INPUT TYPE="Submit" VALUE="Run Query">
</FORM>
</BODY>
</HTML>
and this is my test.asp:
<% @Language=VBScript %>
<html>
<head>
<title>test</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<% type=Request.Form("type"
'Connects to the Access driver and Access database in the Inetpub directory where the database is saved
strProvider = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=E:\Inetpub\'Creates an instance of an Active Server component
set objConn = server.createobject("ADODB.Connection"
'Opens the connection to the data store
objConn.Open strProvider
'Instantiate Command object and use ActiveConnection property to
'attach connection to Command object
set cm = Server.CreateObject("ADODB.Command"
cm.ActiveConnection = objConn
if (type = 1) then
sqltext = "SELECT * FROM Car"
elseif (type = 2) then
sqltext = "SELECT * FROM Boat"
elseif (type = 3) then
sqltext = "SELECT * FROM Star"
elseif (type = 4) then
sqltext = "SELECT * FROM House"
elseif (type = 5) then
sqltext = "SELECT * FROM Computer"
end if
'set cnn = Server.CreateObject("ADODB.Connection"
'cnn.Open "driver={Microsoft Access Driver (*.mdb)};;DBQ=E:\Inetpub\set Results= cnn.Execute(sqltext)
do until Results.eof
Response.Write(Results("Cost")
Results.movenext
loop
%>
</form>
</body>
</html> ruth.jonkman@wcom.com