BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TADODataSet and TADOTable

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO)
View previous topic :: View next topic  
Author Message
TumurS
Guest





PostPosted: Mon May 07, 2007 8:10 am    Post subject: TADODataSet and TADOTable Reply with quote



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
Back to top
TumurS
Guest





PostPosted: Mon May 07, 2007 8:10 am    Post subject: Re: TADODataSet and TADOTable Reply with quote



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 (AT) pixel (DOT) mn> wrote in message
news:463eada1$1 (AT) newsgroups (DOT) borland.com...
Quote:
I replaced TADODataSet with TADOTable and nothing changed:
the problem with 0 key still exists. What am I doing wrong?


"TumurS" <spam_tumurbaatar (AT) pixel (DOT) mn> wrote in message
news:463ea372$1 (AT) newsgroups (DOT) 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



Back to top
TumurS
Guest





PostPosted: Mon May 07, 2007 8:10 am    Post subject: Re: TADODataSet and TADOTable Reply with quote



I replaced TADODataSet with TADOTable and nothing changed:
the problem with 0 key still exists. What am I doing wrong?


"TumurS" <spam_tumurbaatar (AT) pixel (DOT) mn> wrote in message
news:463ea372$1 (AT) newsgroups (DOT) borland.com...
Quote:
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

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.