Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages
Started by TumurS
Mon, 07 May 2007 03:57
TADODataSet and TADOTable
Author: TumurS
Date: Mon, 07 May 2007 03:57
Date: Mon, 07 May 2007 03:57
26 lines
1954 bytes
1954 bytes
In my previous project there was no problem with working TADOTable object.
Inserting, editing, removing and etc worked well. Cursor location and type
are client and static. Auto-increment fields values retrieved correctly by
engine
after inserting new record operation.
I dont' remember why I choosed TADODataSet for another project, but
now I encountered some problem. CommandType is cmdTable and cursor's
location/type are same as above. After inserting a new record it's
auto-increment key field
has 0 value. I cannot do any further operation on it because the key is
wrong.
So I added this line just after opening dataset:
(*dataset->Properties)[OleVariant(WideString("Update Resync"))]->Value =
adResyncAll;
(by the way, to refer to above constant I manually included <adodb_xp.h>. is
it safe?)
Now the new record disappears from local cache just after posting. Any
ideas?
Also, if my code retrieving all records from the server (i.e. no WHERE), is
there
any difference between using table and query?
P.S. MSSQL2K and BCB6
Re: TADODataSet and TADOTable
Author: TumurS
Date: Mon, 07 May 2007 04:41
Date: Mon, 07 May 2007 04:41
34 lines
2279 bytes
2279 bytes
I replaced TADODataSet with TADOTable and nothing changed:
the problem with 0 key still exists. What am I doing wrong?
"TumurS" <spam_tumurbaatar@pixel.mn> wrote in message
news:463ea372$1@newsgroups.borland.com...
> In my previous project there was no problem with working TADOTable object.
> Inserting, editing, removing and etc worked well. Cursor location and type
> are client and static. Auto-increment fields values retrieved correctly by
> engine
> after inserting new record operation.
> I dont' remember why I choosed TADODataSet for another project, but
> now I encountered some problem. CommandType is cmdTable and cursor's
> location/type are same as above. After inserting a new record it's
> auto-increment key field
> has 0 value. I cannot do any further operation on it because the key is
> wrong.
> So I added this line just after opening dataset:
>
> (*dataset->Properties)[OleVariant(WideString("Update Resync"))]->Value
> = adResyncAll;
>
> (by the way, to refer to above constant I manually included <adodb_xp.h>.
> is it safe?)
>
> Now the new record disappears from local cache just after posting. Any
> ideas?
> Also, if my code retrieving all records from the server (i.e. no WHERE),
> is there
> any difference between using table and query?
>
> P.S. MSSQL2K and BCB6
>
>
Re: TADODataSet and TADOTable
Author: TumurS
Date: Mon, 07 May 2007 05:59
Date: Mon, 07 May 2007 05:59
48 lines
2750 bytes
2750 bytes
I found where was the problem, but another one is raised.
My dataset has details TADOQuery object.
Disabling this query (i.e. I does not open it anyway) eliminates the
problem.
The key column receives auto-incremented values normally.
But how to establish master-details schema in this case?
"TumurS" <spam_tumurbaatar@pixel.mn> wrote in message
news:463eada1$1@newsgroups.borland.com...
>I replaced TADODataSet with TADOTable and nothing changed:
> the problem with 0 key still exists. What am I doing wrong?
>
>
> "TumurS" <spam_tumurbaatar@pixel.mn> wrote in message
> news:463ea372$1@newsgroups.borland.com...
>> In my previous project there was no problem with working TADOTable
>> object.
>> Inserting, editing, removing and etc worked well. Cursor location and
>> type
>> are client and static. Auto-increment fields values retrieved correctly
>> by engine
>> after inserting new record operation.
>> I dont' remember why I choosed TADODataSet for another project, but
>> now I encountered some problem. CommandType is cmdTable and cursor's
>> location/type are same as above. After inserting a new record it's
>> auto-increment key field
>> has 0 value. I cannot do any further operation on it because the key is
>> wrong.
>> So I added this line just after opening dataset:
>>
>> (*dataset->Properties)[OleVariant(WideString("Update Resync"))]->Value
>> = adResyncAll;
>>
>> (by the way, to refer to above constant I manually included <adodb_xp.h>.
>> is it safe?)
>>
>> Now the new record disappears from local cache just after posting. Any
>> ideas?
>> Also, if my code retrieving all records from the server (i.e. no WHERE),
>> is there
>> any difference between using table and query?
>>
>> P.S. MSSQL2K and BCB6
>>
>>
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads