What I need to do is insert multiple records into a table.
The table is set up something like
ID
FirstName
LastName
Company
Then I have an array with a variable amount of records.
For example
John
Doe
Msoft
Jane
Doe
Msoft
etc…
The user chooses what to name there columns so I’m using an additional array so my INSERT statement looks something like
SQL = "INSERT INTO MailingList (ShopCartID, "&split_location(0)&", "&split_location(1)&", "&split_location(2)&", "&split_location(3)&", "&split_location(4)&", "&split_location(5)&", "&split_location(6)&") Values ('"&ShopCartID&"', '"&total_split_text(0)&"', '"&total_split_text(1)&"', '"&total_split_text(2)&"', '"&total_split_text(3)&"', '"&total_split_text(4)&"', '"&total_split_text(5)&"', '"&total_split_text(6)&"')"
Now this works fine but only for 1 record. What I need to do is somehow loop this - I’ve read stored procedures is a good option but I really don’t know anything about them. I’m hoping I’m just overcomplicating this.
Thanks in advance.