Hi everyone,
I am not sure if this is possible but please allow me to ask anyway.
There are 3 specifications I am required to implement, all on the same page.
I need to create a screen for the user to store records into an access database.
On this screen, the user needs to know the total number of records stored on the database so far; the useer needs to know the last item number stored, and last but not least, the user needs to have me display the next item number to be stored.
It should look like this:
The total number of items inserted into db: the total | Last Item Inserted into db: the Number
Then a dropdown will display the next number to be inserted.
If for instance the last number inserted is 527, then the next number to be inserted will be 528.
These numbers are NOT auto numbers. They are inserted manually.
I believe I have implemented the first 2, though it could be more efficient but that should be ok.
I am, however, having a hard time implementing the last spec, which is showing the next number to be stored.
I was wondering if anyone could lend me a help.
I am not even sure it is possible.
Thanks and here is the code I currently have.
<html>
<head>
<title>Storing Scanned Files</title>
<style>
body, input { font-family:verdana,arial; font-size:10pt; }
</style>
<TITLE>Accident Report</TITLE>
</head>
<body >
<%
dim safetyDB,sql,rs,rs1,rs2
set safetyDB = Server.CreateObject("ADODB.Connection"
safetyDB.Open "dsn=itemStore"
sql = "SELECT count(Orgid) as Total FROM ORG "
set rs1 = safetyDB.Execute(sql)
%>
<form method="POST" enctype="multipart/form-data" action="testEquipSpec.asp">
<table border="1" bordercolor=black align="center" bgcolor="ffffff">
<tr>
<td><font color="IndianRED"><b>Total Item Spec stored in our database so far is:</b></font></td>
<td><input size="5" type="text" value="<%=rs1("total"%>"></td>
<td><font color="steelBLUE"><b>Last Inserted Number :</b></font></td>
<td>
<select name="LastInserted" disabled>
<%
sql = "SELECT ORG.Orgid, ORG.ORGCODE FROM ORG ORDER BY ORG.ORGCODE DESC"
set rs = safetyDB.Execute(sql)
While not rs.EOF
%>
<OPTION value="<%=rs(0)%>"><%=rs(1)%></OPTION>
<%
rs.MoveNext
wend
rs.close
set rs=nothing
%>
</select>
</td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table border="1" bordercolor=black align="center" bgcolor="ffffff">
<tr>
<td><p></td></tr>
<tr>
<td><font color="steelBLUE"><b>Next Number :</b></font></td>
<td>
<select name="ItemNumber">
<%
sql = "SELECT ORG.Orgid, ORG.ORGCODE FROM ORG ORDER BY ORG.ORGCODE DESC"
set rs2 = safetyDB.Execute(sql)
While not rs2.EOF
%>
<OPTION value="<%=rs2(0)%>"><%=rs2(1)%></OPTION>
<%
rs2.MoveNext
wend
rs2.close
set rs2=nothing
%>
</select>
</td>
</tr>
<tr>
<td>Scanned File :</td><td>
<input type="file" name="file" size="40"></td>
</tr>
<tr>
<td> </td><td><input type="submit" value="Submit">
<input type="button" value="Item Listings" onclick="location='listItems.asp'">
</tr>
</table>
</form>
<%
safetyDB.close
set safetyDB = nothing
%>
</body>
</html>
I am not sure if this is possible but please allow me to ask anyway.
There are 3 specifications I am required to implement, all on the same page.
I need to create a screen for the user to store records into an access database.
On this screen, the user needs to know the total number of records stored on the database so far; the useer needs to know the last item number stored, and last but not least, the user needs to have me display the next item number to be stored.
It should look like this:
The total number of items inserted into db: the total | Last Item Inserted into db: the Number
Then a dropdown will display the next number to be inserted.
If for instance the last number inserted is 527, then the next number to be inserted will be 528.
These numbers are NOT auto numbers. They are inserted manually.
I believe I have implemented the first 2, though it could be more efficient but that should be ok.
I am, however, having a hard time implementing the last spec, which is showing the next number to be stored.
I was wondering if anyone could lend me a help.
I am not even sure it is possible.
Thanks and here is the code I currently have.
<html>
<head>
<title>Storing Scanned Files</title>
<style>
body, input { font-family:verdana,arial; font-size:10pt; }
</style>
<TITLE>Accident Report</TITLE>
</head>
<body >
<%
dim safetyDB,sql,rs,rs1,rs2
set safetyDB = Server.CreateObject("ADODB.Connection"
safetyDB.Open "dsn=itemStore"
sql = "SELECT count(Orgid) as Total FROM ORG "
set rs1 = safetyDB.Execute(sql)
%>
<form method="POST" enctype="multipart/form-data" action="testEquipSpec.asp">
<table border="1" bordercolor=black align="center" bgcolor="ffffff">
<tr>
<td><font color="IndianRED"><b>Total Item Spec stored in our database so far is:</b></font></td>
<td><input size="5" type="text" value="<%=rs1("total"%>"></td>
<td><font color="steelBLUE"><b>Last Inserted Number :</b></font></td>
<td>
<select name="LastInserted" disabled>
<%
sql = "SELECT ORG.Orgid, ORG.ORGCODE FROM ORG ORDER BY ORG.ORGCODE DESC"
set rs = safetyDB.Execute(sql)
While not rs.EOF
%>
<OPTION value="<%=rs(0)%>"><%=rs(1)%></OPTION>
<%
rs.MoveNext
wend
rs.close
set rs=nothing
%>
</select>
</td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table>
<tr>
<td><p></td>
</tr>
</table>
<table border="1" bordercolor=black align="center" bgcolor="ffffff">
<tr>
<td><p></td></tr>
<tr>
<td><font color="steelBLUE"><b>Next Number :</b></font></td>
<td>
<select name="ItemNumber">
<%
sql = "SELECT ORG.Orgid, ORG.ORGCODE FROM ORG ORDER BY ORG.ORGCODE DESC"
set rs2 = safetyDB.Execute(sql)
While not rs2.EOF
%>
<OPTION value="<%=rs2(0)%>"><%=rs2(1)%></OPTION>
<%
rs2.MoveNext
wend
rs2.close
set rs2=nothing
%>
</select>
</td>
</tr>
<tr>
<td>Scanned File :</td><td>
<input type="file" name="file" size="40"></td>
</tr>
<tr>
<td> </td><td><input type="submit" value="Submit">
<input type="button" value="Item Listings" onclick="location='listItems.asp'">
</tr>
</table>
</form>
<%
safetyDB.close
set safetyDB = nothing
%>
</body>
</html>