jjr0319
11-08-2005, 02:34 PM
i created a web page that users can go into and add workcounts to an access database based upon the type of work they did.
here's an example:
<tr>
<td ALIGN=LEFT>
<SELECT name="WORKTYPE">
<OPTION selected value="">Please select
<OPTION value="Catalogging">Catalogging
<OPTION value="Data Entry">Data Entry
</SELECT>
</td>
</tr>
<tr>
<td ALIGN=RIGHT VALIGN=TOP class="text">Workcount:</td>
<td ALIGN=LEFT><input name="WORKCOUNT" size=10 maxlength="10"></td>
</tr>
when the user selects a WORKTYPE, and enters a WORKCOUNT, the database gets updated with their input. If catalogging or any other WORKTYPE is chosen twice, however, instead of adding the value of WORKCOUNT to the existing catalogging record in the database, it adds a new record completely. I know I would have to use the UPDATE statement in SQL, but I'm not sure how to set it up so that it first checks the database to see if any other records contain "catalogging" or the selected WORKTYPE.
here's my ASP code so far:
<html>
<head>
<title>IDOC Workcount</title>
</head>
<body class="tablewhite">
<%putWT=request.form("WORKTYPE")
putWC=request.form("WORKCOUNT")
set conn=Server.CreateObject("ADODB.Connection")
conn.ConnectionString="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=d:\Inetpub\wwwroot\subs\IDOC\IDOC.mdb;"
conn.Open
set rs=Server.CreateObject("ADODB.Recordset")
sql="INSERT INTO [WORK_COUNT] ([WORKTYPE], [WORKCOUNT]) VALUES ('" & putWT & "', '" & putWC & "')"
conn.execute sql
%>
<h2>Your workcount has been added to the IDOC database</h2>
<P>Click on your browser's <I>Back</I> button to return to the workcount input page or . . .
</body>
</html>
anyone know how to set this up? thanks in advance.
here's an example:
<tr>
<td ALIGN=LEFT>
<SELECT name="WORKTYPE">
<OPTION selected value="">Please select
<OPTION value="Catalogging">Catalogging
<OPTION value="Data Entry">Data Entry
</SELECT>
</td>
</tr>
<tr>
<td ALIGN=RIGHT VALIGN=TOP class="text">Workcount:</td>
<td ALIGN=LEFT><input name="WORKCOUNT" size=10 maxlength="10"></td>
</tr>
when the user selects a WORKTYPE, and enters a WORKCOUNT, the database gets updated with their input. If catalogging or any other WORKTYPE is chosen twice, however, instead of adding the value of WORKCOUNT to the existing catalogging record in the database, it adds a new record completely. I know I would have to use the UPDATE statement in SQL, but I'm not sure how to set it up so that it first checks the database to see if any other records contain "catalogging" or the selected WORKTYPE.
here's my ASP code so far:
<html>
<head>
<title>IDOC Workcount</title>
</head>
<body class="tablewhite">
<%putWT=request.form("WORKTYPE")
putWC=request.form("WORKCOUNT")
set conn=Server.CreateObject("ADODB.Connection")
conn.ConnectionString="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=d:\Inetpub\wwwroot\subs\IDOC\IDOC.mdb;"
conn.Open
set rs=Server.CreateObject("ADODB.Recordset")
sql="INSERT INTO [WORK_COUNT] ([WORKTYPE], [WORKCOUNT]) VALUES ('" & putWT & "', '" & putWC & "')"
conn.execute sql
%>
<h2>Your workcount has been added to the IDOC database</h2>
<P>Click on your browser's <I>Back</I> button to return to the workcount input page or . . .
</body>
</html>
anyone know how to set this up? thanks in advance.