Help with a looping Insert

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I am trying to take the results of a data entry page and insert into a
table. I do not know how to make a query loop.
I keep getting an error: Object doesn't support this property or method:
'rs.execute'

Can you help?

Thanks in advance

Dave
---------------------------------------------------------------------------------------
myMaxI = Request.Form ("MaxI")

ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="&Server.Mappath("../fpdb/LMS.mdb")&""
set rs = Server.CreateObject("ADODB.Recordset")
mysql="SELECT * FROM QRegInfo"
rs.open mySql, ConnStr

FOR i = 0 TO myMaxI
mySQL = "INSERT INTO StuReg(HotelChrg) VALUES (" &
Request.form("HotelChrg"&i) & ")"
rs.execute(mySQL)
NEXT

rs.Close
Set rs = nothing
 
The ADO RecordSet object has no Execute method. Take a look at the following
article on my web site, and pay close attention to the section on the
Command object:

http://www.takempis.com/adoobjects.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
Back
Top