Help with a looping Insert

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
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top