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

Looped Insert help needed

Status
Not open for further replies.

dcwave

IS-IT--Management
May 18, 2003
46
0
0
US
Greetings,
I am not sure I understand how to do a looped insert and could use some help and maybe some code examples so that I can undertand what's happening. I have read some posts regarding this but I don't think I have enough info to know if what I am reading applies.

I have two tables in access.
Table 1 has some general info about PBXs
Table 2 has connectivity options. The relationship is on the PBXID

Table 2 layout is as follows:
PBXID, Resource, Connection, EndPoint, Sig, SupDisc, DNIS, ANI, Flash

The "form" page will have 5 rows (5 resources) and 8 columns with a 9th hidden to hold the PBXID.

Help me understand how to create the SQL that will loop through each row and insert into the table, please.

Do is use a For Loop? A Do until EOF loop?

Do you need more info?
Thanks.

Here is the html for the form page (not complete but gives you an idea on how its layed out - the hidden PBXID field is NOT in place yet)

Code:
<form name="input" action="SubmitTech.asp" method="get">
			<table>
				<!-- resource connectivity -->
				<tr><th colspan="8">Preferred Connectivity</td><tr>
				<tr>
					<td>CTC Resource</td>
					<td>Connection Type</td>
					<td>End Point</td>
					<td>Signaling</td>
					<td>Supervised Disconnect</td>
					<td>Flash</td>
					<td>DNIS</td>
					<td>ANI</td>
				</tr>
				<tr>
					<td>PD</td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
				</tr>
				<tr>
					<td>IC</td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
				</tr>
				<tr>
					<td>IB</td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
				</tr>
				<tr>
					<td>ICX Audio</td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
				</tr>
				<tr>
					<td>Agent Audio</td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
					<td><input></td>
				</tr>
				<tr>
					<td><input type="submit" name="submit" value="Submit"></td>
				<tr>



			</table>

 
did not understand your question completely...so you want to collect all the user entries in this form and want to insert them into your database table... is that correct?

please show us your table structures...

and some sample data...

-DNG
 
Perhaps looking at the page will give you a better idea of what I am looking for.

PBX Table:
ID, PBX Name, Gen Info

Tech Table
ID, PBXID, Resource, Connection, EndPoint, Sig, SupDisc, DNIS, ANI, Flash

Each line item in the form is assiciated with the PBX ID in the PBX table. Meaning this form is connectivity info for a single PBX. So each row will have a hidden field with the PBX ID that gets inserted into the tech Table

How do I loop through the insert for each line item?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top