🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #435

Re: Field cannot be modified error

#435
From: siraj
Date: Fri, 03 Mar 2006 15:09
48 lines
2816 bytes
Thank you for the reply.
It works if the following line is added before the line 
ADOQuery1->FieldByName("id")->AsInteger = 2 ;
ADOQuery1->FieldByName("id")->ReadOnly = false;

So
ADOQuery1->Insert();
ADOQuery1->FieldByName("id")->ReadOnly = false;
ADOQuery1->FieldByName("id")->AsInteger = 2 ;
ADOQuery1->FieldByName("Name")->AsString = "sms";
ADOQuery1->Post();

I am using windows xp sp2 which has MDAC 2.8 sp1  and c++ builder 2006.
I had a c++ bulder 5 program using MDAC 2.8 that I am now converting to c++ 
builder 2006 project.

There are some issues with respect to using server side cursors in MDAC 2.8 
sp1.

I get the error "Provider cannot determine the value. Possible reasons: the 
record was just created, the default value for the field was not available, 
or the user has not set a new value." when using server side cursor with 
batch optimistic mode. If I change the cursor to client side then I do not 
get the error. The only way I can used the server side cursor without error 
is to use it with optimistic lock.

Storing using client side cursor and batch optimistic lock is 11 times 
slower compared to server side cursor with optimistic lock for 5000 values.

I have seen that storing using server side cursor with batch optimistic lock 
is faster in c++ builder 5 and MDAC 2.8.

How to use the server side cursor with batch optimistic lock in windows xp 
sp2 and MDAC 2.8 sp1?

My main intention is to reduce the storing time as I have to store large 
number of values.

"Adriano Grandi" <adriano@cedepp.it> wrote in message 
news:440721c0@newsgroups.borland.com...
>
> You must use:
> ADOQuery1->Insert();
> ADOQuery1->FieldByName("id")->AsInteger = 2 ;
> ADOQuery1->FieldByName("Name")->AsString = "sms";
> ADOQuery1->Post();
>
> 
Technical Details
Message-ID: <44085c1f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4406a9d4@newsgroups.borland.com> <440721c0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,a7a9d6e24de244a5
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "siraj" <siraj.sm@omnisens.ch>
From: "siraj" <siraj.sm@omnisens.ch>
Newsgroups: borland.public.cppbuilder.database.ado
References: <4406a9d4@newsgroups.borland.com> <440721c0@newsgroups.borland.com>
Subject: Re: Field cannot be modified error
Date: Fri, 3 Mar 2006 16:09:14 +0100
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
X-Antivirus: avast! (VPS 0609-3, 03/03/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 212.109.69.36
Message-ID: <44085c1f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1141398559 212.109.69.36 (3 Mar 2006 07:09:19 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail