ADO Error Message

J

Joe Delphi

Hi,

I keep getting an error message about No Value Given for Required
Parameter on the DBConn.Execute line near the bottom of my code below.

Dim rs As ADODB.RecordSet
Dim rs2 As ADODB.RecordSet

For i = 1 To rs.RecordCount
MonthlyConstCost(i) = PctTotalCost(i) * TotalConstCost

strUpdate = "UPDATE tblCashFlowSummary " & _
"SET INFRA_COSTS = " & MonthlyConstCost(i) & " " & _
"WHERE SCENARIO_ID = " & CStr(ScenarioID) & " AND MONTHLY_ID
= " & CStr(MonthID(i))

Set rs2 = DBConn.Execute(strUpdate)
Next i

----------------------------------------------------------
What am I doing wrong? According to the documentation, the only parameter
required by the Execute command is the first parameter, which I have
supplied.

JD
 
J

Joe Delphi

Set rs2 = DBConn.Execute(strUpdate)
Next i

----------------------------------------------------------
What am I doing wrong? According to the documentation, the only parameter
required by the Execute command is the first parameter, which I have
supplied.

JD

I found the cause, I needed an adExecuteNoRecords argument because it was an
update and not returning any records.

JD
 
T

Terry Kreft

Your last line just needed to be

DBConn.Execute strUpdate

As it's an update you don't need to assign it to a recordset at all.
 

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