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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to run asp pages - Unable to retrieve values from MS Access DB

Status
Not open for further replies.

fmasin

Technical User
May 3, 2002
163
GB
Hi,

Could anyone tell what might be wrong with the follwing code....I cannot retrive values from the database....and yet no error is being displayed...could it possibly be a problem with my IIS configuration?

Connection string:

<%
Option Explicit
Dim myConn, myDb, rs, rs2, sql
myDb = "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Test\videlibforasp.mdb"
Set myconn = server.createobject("ADODB.connection")
myConn.open myDb
set rs = server.createobject("ADODB.Recordset")
set rs2 = server.createobject("ADODB.Recordset")
%>

'Rental Entry:

<%@ LANGUAGE="VBSCRIPT" %>

<!--#include file="connect .asp" -->
<!--#include file="log.asp" -->
<html>
<head>
<SCRIPT LANGUAGE = "Javascript">
function checkall(theForm){

if (theForm.Rental_Date.value == ""){
alert("You must enter a Rental_Date");
return (false);}



if (theForm.Duration_Id.value == ""){
alert("You must select a Duration period");
return (false);}

if (theForm.Member_Id.value == ""){
alert("You must enter a Member_Id");
return (false);}

if (theForm.Item_Id.value == ""){
alert("You must enter an Item_Id");
return (false);}


//if (theForm..value == ""){
//alert("You must enter a Address");
//return (false);}






}
</SCRIPT > </head>

<body bgcolor="#FFFFFF" text="#000000">
<p align="center"><font face="Times New Roman, Times, serif" size="4">Rental Entry
</font></p>

<form name = "f" method="POST" onsubmit = "return checkall(this);" action="RentalUpdate.asp">
<div align="center">
<center>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber2" width="621">


<tr>
<td width="194">Rental_Date</td>
<td width="424">
<p align="left">
<input name="Rental_Date" size="43" ></td>
</tr>

<tr>
<td width="194">Return_Date</td>
<td width="424">
<p align="left">
<input name="Return_Date" size="43" ></td>
</tr>


<tr>
<td width="194">Duration</td>
<td width="424">
<p align="left">

<select size="1" name="Duration_Id" style="width: 310; height: 310">
<%
sql = "Select * from tblDuration ORDER BY Duration"
rs.open sql,myconn,3,3
do until rs.eof
%>
<option value = "<%=rs("Duration_Id")%> <%=rs("Duration")%> </option>
<%
rs.movenext
Loop
rs.close
%>
</select>
</td>
</tr>

<tr>
<td width="194">Member_Id</td>
<td width="424">
<p align="left">
<input name="Member_Id" size="43" ></td>
</tr>

<tr>
<td width="194">Item_Id</td>
<td width="424">
<p align="left">
<input name="Item_Id" size="43" ></td>
</tr>





</table>
</center>
</div>
<p align="center">
<br>

<input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2">
</p>
</form>
</body>

</html>




Thanks and regards,

Francis
 
this
Code:
<option value = "<%=rs("Duration_Id")%> <%=rs("Duration")%> </option>

should be

Code:
<option value = "<%=rs("Duration_Id")%>"> <%=rs("Duration")%>



Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top