Results 1 to 2 of 2


  1. #1
    Join Date
    Dec 1969

    Default NEED HELP ASAP

    I want to be able to add products into a sql database. However if I have a form that adds products to database I want to be able to insert multiple records using the same form. EX: I have product xyz however there are multiple product sizes. On my form page I have a list box that allows me to select many different sizes for this product. I then select all sizes that correspond with this product. I submit this entry and then take a look at the database and see multiple entries for this product showing all the available sizes. I need to know how to write the query to insert multiple records using one form. This code is obviously ASP code. Any help would help!!!

  2. #2
    Join Date
    Dec 1969

    Default Have you tried...

    Using a for...loop<BR><BR>You should be getting the list box sent over as a comma seperated string, and with that, yu could use the split command. Then build your SQL statement and insert into the database.<BR><BR>Or an alternative would be something like ...<BR><BR>You have a table with a list of all the sizes in it that you support. Then, you could do one insert statement like...<BR><BR>strSQL = "INSERT INTO tablename (SELECT frmField1, frmField2, sizetable.size FROM sizetable WHERE size IN (" & commaseperatedvariablename & ") "<BR><BR>I am not sure about the syntax, but I think you get the idea.<BR><BR>HTH<BR><BR>Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts