Thread: Insert issue?
View Single Post
  #12 (permalink)  
Old June 16th, 2005, 05:06 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

What happens when you modify the loop like this:
Code:
Response.Write("Location is " & Request.Form("locations") & "<br />")

For Each location In Request.Form("locations")
  set cominsert = Server.CreateObject("ADODB.Command")
  cominsert.ActiveConnection = MM_sample_tracking_STRING
  cominsert.CommandText = "INSERT INTO tblsamples (Freezer, Tower, Box, Location, UPN, UPNA, Date_Drawn, Date_Stored, Person_Storing, Total_Vials, Freezing_Method, Comments)  VALUES ('" + Replace(cominsert__varfreezer, "'", "''") + "', '" + Replace(cominsert__vartower, "'", "''") + "', '" + Replace(cominsert__varbox, "'", "''") + "', '" + Replace(cominsert__varlocation, "'", "''") + "', '" + Replace(cominsert__varupn, "'", "''") + "', '" + Replace(cominsert__varupna, "'", "''") + "', '" + Replace(cominsert__vardate_drawn, "'", "''") + "', '" + Replace(cominsert__vardate_stored, "'", "''") + "', '" + Replace(cominsert__varperson_storing, "'", "''") + "', '" + Replace(cominsert__vartotal_vials, "'", "''") + "', '" + Replace(cominsert__varfreezing_method, "'", "''") + "', '" + Replace(cominsert__varcomments, "'", "''") + "') "

'cominsert.CommandType = 1
'cominsert.CommandTimeout = 0
'cominsert.Prepared = true
'cominsert.Execute()
Response.Write("Sql Statement is " & cominsert.CommandText & "<br />")

Next
What do you get? Multiple Sql statements?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote