If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Arrays, Multiple Records

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-16-04, 16:23
Decaye Decaye is offline
Registered User
 
Join Date: Feb 2004
Posts: 1
Arrays, Multiple Records

I've got a major problem. I have a form, with a drop down box, a text field and two text areas. The drop down is a list of zones (game zones) with they're own unique ID as a value. The text box is called Leader (which is a persons name and points earned, more on that later), the first text area is a list of players and they're points and the second text area is a list of equipment found in that zone. My problem is this. I have a table in access, called Equipment. It has five Columns. EQID which is autonumber and primary, EQDATE, ZONEID, ID (players unique ID which would match with leader), and EQ (a text listing of equipment).
Now ZONEID AND ID need to be pulled from two different tables. One is tblZones and the other tblUsers. My issue is how do i have them submit this info and update the Equipment table in an array according to how many equipment items they submit. For example...

FORM 1.asp
Zone: Pluto (dropdown name value=unique id, pulled from tblZones)
Leader: Decaye (text field, will request.form and open tblusers to match id)
Players (forget this for now, because I have to think of a way to use split correctly with this)
Equipment ( works perfectly, with this code below, A user can paste his equipment with one line, press enter, enter as many as he wants and this code updates all the next available rows)

<%

strTextArea = request.form("Equipment")
arrTextLines = Split(strTextArea,vbNewLine,-1,1)
For i = 0 To UBound(arrTextLines)
strEqlist = arrTextLines(i)

Set rsEQ = Server.CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO equipment (eq) VALUES('" & strEqlist & "')"
rsEq.Open strSQL, adocon, 1, 3

Next

adocon.Close
Set adocon = Nothing

%>

Now, that works great for the EQ column and EQID (autonumber) naturally follows suit. My problem is how can I have the date, which would be now() arrayed, the leader arrayed in the ID column, even though that value is found in another table and ZONEID arrayed, also another table, based only on the random amount of data found in the equipment field. To look something like this.

Say we only entered 3 pieces of eq.

We'd want our table to look like this

EQID EQDATE ZONEID ID EQ
1 2/16/04 20 5 rocks
2 2/16/04 20 5 stones
3 2/16/04 20 5 sticks


AGAIN Zoneid and ID are from other tables, how can i get those and the date into the same array as eq, so when the EQ array - whatever number (it will always be random) is submitted then date is added X amount of times in it's column, Zoneid and id the same and end when the EQ array ends. Did that make sense?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On