Problem: I need to write data to an access database. Each line has a "CheckBox" in front of it and for those that I "Check", I need to write to the database. Each row must be written in the database seperately.
Bad Explanation: I read from the ""SMS Machines at all Sites"" access database, specific rows that I need (an asp file). I put a "Check Box" in front of each row during the import to my form. I then want to check each row that I want to submit to read those specific "CheckBox" rows into a "Results" access Database. However, all fields are being written in one row. I need to seperate each row and write each row one at a time
Source Code: Here is my complete code. I am using FrontPage (which doesn't have any good references as for as I can see) on the creation of this:
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next
strErrorUrl = ""
If Request.ServerVariables("R
EQUEST_MET
HOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject("ADODB
.Connectio
n")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateObject("ADODB
.Recordset
")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("appdetailssms
_Connectio
nString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(1)
Dim arFormDBFields0(1)
Dim arFormValues0(1)
arFormFields0(0) = "myChoice1"
arFormDBFields0(0) = "myChoice1"
arFormValues0(0) = Request("myChoice1")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
If Request.ServerVariables("R
EMOTE_HOST
") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("R
EMOTE_HOST
"), "Remote_computer_name"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("R
EMOTE_USER
") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("R
EMOTE_USER
"), "User_name"
End If
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"appdetailssms.asp",_
"Return to the form."
End If
End If
%>
<%
Survey=Request.Cookies("DC
SITMDEWEBP
AGE")
Response.Write(Session(Nam
e))
%>
<HTML>
<HEAD>
<TITLE>prtnav</TITLE>
<base target="_self">
<style fprolloverstyle>A:hover {color: #FF0000; font-family: Arial; font-size: 12pt}
</style>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<!-- URL's used in the movie-->
<table border="1" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<thead>
</thead>
<tbody>
</tbody>
</table>
<form method="POST" action="--WEBBOT-SELF--" name="SMSSubMit">
<!--webbot bot="SaveDatabase" suggestedext="asp" u-asp-include-url="../../_
fpclass/fp
dbform.inc
" s-dataconnection="DCSAPPS1
" s-recordsource="Results" u-database-url="../../fpdb
/WEB.mdb" s-builtin-fields="HTTP_USE
R_AGENT REMOTE_HOST Timestamp REMOTE_USER" s-builtin-dbfields="Browse
r_type Remote_computer_name Timestamp User_name" s-form-fields="A1 A2 A3 A4 MyChoice1" s-form-dbfields="A1 A2 A3 A4 myChoice1" -->
<table width="100%" border="1">
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="SiteCode,Na
me0,UserNa
me0,Captio
n0,Remote_
computer_n
ame,User_n
ame,Browse
r_type,Tim
estamp,Nam
e,General_
Descriptio
n,Departme
nt,Field4,
Field5,Dis
tribution_
Method,Fie
ld7,Versio
n,Field9,F
ield10,Fie
ld11,Field
12,Field13
,Wise_Job_
Deployment
_Location,
Field15,Fi
eld16,Fiel
d17,Field1
8,Field19,
Field20,Fi
eld21,Fiel
d22,Field2
3,Field24,
Field25,Fi
eld26,Fiel
d27,Field2
8,Field29,
Field30,Fi
eld31,Fiel
d32,Field3
3,Field34,
Field35,Fi
eld36,Fiel
d37,Field3
8,Field39,
Field40" s-columntypes="202,202,202
,202,202,2
02,202,135
,202,202,2
02,202,202
,202,202,2
02,202,202
,202,202,2
02,202,202
,202,202,2
02,202,202
,202,202,2
02,202,202
,202,202,2
02,202,202
,202,202,2
02,202,202
,202,202,2
02,202,202
" s-dataconnection="DCSAPPS1
" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="Caption0" s-menuvalue="Caption0" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource s-displaycolumns="SiteCode
,Name0,Use
rName0,Cap
tion0,Name
,Version" s-criteria s-order s-sql="SELECT Distinct V1.*, V2.*<br>FROM &quot;SMS Machines at all Sites&quot; V1, &quot;DCS_Desktop_Engi
neering&am
p;quot; V2<br>WHERE V1.SiteCode = '::Department::'<br>
AND V2.Name = '::Name::'<br>AND V2.Version = '::Version::'<br>AND
V1.UserName0 &lt;&gt; 'NULL'<br>AND V1.Name0 &lt;&gt; 'NULL'<br>AND V2.Field11 = 'Win2000'<br>AND V2.Field7 = 'DCX Developed'<br>" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="Departmen
t=&amp
;Name=&
;amp;Versi
on=" s-norecordsfound="Automate
d Distribution is currently not available for this application" i-maxrecords="0" i-groupsize="0" botid="4" u-dblib="../../_fpclass/fp
dblib.inc"
u-dbrgn1="../../_fpclass/f
pdbrgn1.in
c" u-dbrgn2="../../_fpclass/f
pdbrgn2.in
c" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00"
; align="left" width="100%">
<font color="#000000"&
gt;This is the start of a Database Results region.</font></t
d></
tr>" startspan b-InForm="TRUE" b-WasTableFormat="TRUE" b-ReplaceDatabaseRegion="F
ALSE" --><!--#include file="../../_fpclass/fpdbl
ib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT Distinct V1.*, V2.* FROM ""SMS Machines at all Sites"" V1, ""DCS_Desktop_Engineering"
" V2 WHERE V1.SiteCode = '::Department::' AND V2.Name = '::Name::' AND V2.Version = '::Version::' AND V1.UserName0 <> 'NULL' AND V1.Name0 <> 'NULL' AND V2.Field11 = 'Win2000' AND V2.Field7 = 'DCX Developed' "
fp_sDefault="Department=&N
ame=&Versi
on="
fp_sNoRecords="<tr><td colspan=6 align=left width=""100%"">Automated Distribution is currently not available for this application</td></tr>"
fp_sDataConn="DCSAPPS1"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Caption0"
fp_sMenuValue="Caption0"
fp_iDisplayCols=6
fp_fCustomQuery=True
BOTID=4
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbr
gn1.inc"--
>
<!--webbot bot="DatabaseRegionStart" endspan i-CheckSum="55711" --><tr>
<td>
<INPUT type=checkbox name=MyChoice1 value="<%=FP_FieldVal(fp_r
s,"Name0")
%>,<%=FP_F
ieldVal(fp
_rs,"Capti
on0")%>,<%
=FP_FieldV
al(fp_rs,"
Name0")%>,
<%=FP_Fiel
dVal(fp_rs
,"UserName
0")%>,<%=F
P_FieldVal
(fp_rs,"Na
me")%> <%=FP_FieldVal(fp_rs,"Vers
ion")%>"><
/td>
<td>
<input type="text" name=A1 size="35" value="<%=FP_FieldVal(fp_r
s,"Caption
0")%>"></t
d>
<td>
<input type="text" name=A2 size="17" value="<%=FP_FieldVal(fp_r
s,"Name0")
%>"></td>
<td>
<input type="text" name=A3 size="12" value="<%=FP_FieldVal(fp_r
s,"UserNam
e0")%>"></
td>
<td>
<input type="text" name=A4 size="20" value="<%=FP_FieldVal(fp_r
s,"Name")%
><%=FP_Fie
ldVal(fp_r
s,"Version
")%>"> </td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../../_fpclass/f
pdbrgn2.in
c" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00"
; align="left" width="100%">
<font color="#000000"&
gt;This is the end of a Database Results region.</font></t
d></
tr>" startspan --><!--#include file="../../_fpclass/fpdbr
gn2.inc"--
>
<!--webbot bot="DatabaseRegionEnd" endspan i-CheckSum="65064" --></tbody>
</table>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<p align="center"> </p>
<p align="center"><a href="javascript:history.b
ack();"><f
ont face="Arial">BACK</font></
a></p>
<pre></pre>
</BODY>
</HTML>
I did my best to understand the posting at but just couldn't apply it due to my lack of knowledge in this:
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20185284.htmlYou assistance would be with much appreciation.
Thanks in advance,
Christopher Denny