PC Review


Reply
Thread Tools Rate Thread

ADO Error Message

 
 
Joe Delphi
Guest
Posts: n/a
 
      3rd Sep 2006
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?bWF0YXJjYWxsYXJzZQ==?=
Guest
Posts: n/a
 
      3rd Sep 2006
Is INFRA_COSTS a query?

"Joe Delphi" wrote:

> 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
>
>
>

 
Reply With Quote
 
Joe Delphi
Guest
Posts: n/a
 
      3rd Sep 2006
> 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


 
Reply With Quote
 
Terry Kreft
Guest
Posts: n/a
 
      3rd Sep 2006
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.


--

Terry Kreft


"Joe Delphi" <(E-Mail Removed)> wrote in message
news:hAtKg.2183$8J2.802@fed1read11...
> > 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Substitue user message in place of system-generated error message Goldar Microsoft Access 2 21st Jan 2010 07:22 PM
Windows Mail Error Sending a Message - Non-specific Error Message DP4Jesus7 Windows Vista Mail 8 9th Apr 2008 08:37 PM
Error messages generated when I open a message the error message c =?Utf-8?B?QnJvb2tzMTk0Ng==?= Microsoft Outlook Discussion 3 11th Aug 2007 06:42 PM
Error message Kernel 32 causes an error message in krnl.383.exe Dan Windows XP Internet Explorer 3 9th Mar 2004 02:12 PM
Error message immediately after loading XP home --> nvcpl.dll error message Steven Windows XP Setup 1 1st Dec 2003 12:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:28 AM.