Update statement creates Error, when statement is fine

Update statement creates Error, when statement is fine

Post by Mar » Wed, 20 Feb 2002 01:44:46



I am getting one of those great 2147467259 (80004005) Unspecified
error

the statement that is causing this error is

Dim numOfRecords As ADODB.Recordset
Set numOfRecords = CCSMain.CCSConnection.Execute(sql)

We are using Oracle 9i
Where sql is the following update statement:

update ccs_detail set project_id = 4207, cc_number = '0027',
revision_number = '00', description = 'CHANGE ORDER #2 (DATA)',
creation_date = to_date('11/28/01','MM/DD/YY'), billing_code = 'N',
cc_status = 'A', estimate_date = to_date('11/28/2001','MM/DD/YYYY'),
estimate_amount = 3255, submit_date =
to_date('11/28/2001','MM/DD/YYYY'), submit_amount = 3255, budget_date
= to_date('02/15/2002','MM/DD/YYYY'), budget_amount = 3255,
approval_date = to_date('11/30/2001','MM/DD/YYYY'), approval_amount =
3255, paid_date = '', paid_amount = Null, billing_reference =
'01019-20 CO #3 {D}', note_id = 2783, operator = 'KTW', complete =
0.00 where detail_id = 115543

However, if I put this query into SQLPlus or Toad and run it against
the database it runs fine. Why is VB having a problem with it, and how
can I solve the problem?

Thanks
Mark

 
 
 

Update statement creates Error, when statement is fine

Post by Luqma » Wed, 20 Feb 2002 01:54:26


ADODB Recordset is only for Select Query.

For Update Query just use the sql with ConnectionName.Execute Sql.

Like:-

CCSConnection.Execute(sql)

Best Regards,

Luqman


Quote:> I am getting one of those great 2147467259 (80004005) Unspecified
> error

> the statement that is causing this error is

> Dim numOfRecords As ADODB.Recordset
> Set numOfRecords = CCSMain.CCSConnection.Execute(sql)

> We are using Oracle 9i
> Where sql is the following update statement:

> update ccs_detail set project_id = 4207, cc_number = '0027',
> revision_number = '00', description = 'CHANGE ORDER #2 (DATA)',
> creation_date = to_date('11/28/01','MM/DD/YY'), billing_code = 'N',
> cc_status = 'A', estimate_date = to_date('11/28/2001','MM/DD/YYYY'),
> estimate_amount = 3255, submit_date =
> to_date('11/28/2001','MM/DD/YYYY'), submit_amount = 3255, budget_date
> = to_date('02/15/2002','MM/DD/YYYY'), budget_amount = 3255,
> approval_date = to_date('11/30/2001','MM/DD/YYYY'), approval_amount =
> 3255, paid_date = '', paid_amount = Null, billing_reference =
> '01019-20 CO #3 {D}', note_id = 2783, operator = 'KTW', complete =
> 0.00 where detail_id = 115543

> However, if I put this query into SQLPlus or Toad and run it against
> the database it runs fine. Why is VB having a problem with it, and how
> can I solve the problem?

> Thanks
> Mark


 
 
 

Update statement creates Error, when statement is fine

Post by Val Mazu » Wed, 20 Feb 2002 02:37:52


Hi,

UPDATE SQL statement is action query, which does not
return any recordset. Try to do next

CCSMain.CCSConnection.Execute sql,,adCmdText

Val

Quote:>-----Original Message-----
>I am getting one of those great 2147467259 (80004005)
Unspecified
>error

>the statement that is causing this error is

>Dim numOfRecords As ADODB.Recordset
>Set numOfRecords = CCSMain.CCSConnection.Execute(sql)

>We are using Oracle 9i
>Where sql is the following update statement:

>update ccs_detail set project_id = 4207, cc_number
= '0027',
>revision_number = '00', description = 'CHANGE ORDER #2
(DATA)',
>creation_date = to_date('11/28/01','MM/DD/YY'),
billing_code = 'N',
>cc_status = 'A', estimate_date = to_date

('11/28/2001','MM/DD/YYYY'),

- Show quoted text -

Quote:>estimate_amount = 3255, submit_date =
>to_date('11/28/2001','MM/DD/YYYY'), submit_amount = 3255,
budget_date
>= to_date('02/15/2002','MM/DD/YYYY'), budget_amount =
3255,
>approval_date = to_date('11/30/2001','MM/DD/YYYY'),
approval_amount =
>3255, paid_date = '', paid_amount = Null,
billing_reference =
>'01019-20 CO #3 {D}', note_id = 2783, operator = 'KTW',
complete =
>0.00 where detail_id = 115543

>However, if I put this query into SQLPlus or Toad and run
it against
>the database it runs fine. Why is VB having a problem
with it, and how
>can I solve the problem?

>Thanks
>Mark
>.

 
 
 

Update statement creates Error, when statement is fine

Post by Harinatha Reddy Gorl » Wed, 20 Feb 2002 14:14:57


HI
No need to use recordset here.
Execute method of both ADO conection and Command Objects gives you an
option to include "RecordsAffected" parameter.
It is a Long variable to which the provider returns the number of
records that the operation affected.

Harinatha Reddy Gorla MCSD,MCDBA
        Software Engineer
Smart Software Technologies,
Hyderabad, India

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!