Article View: borland.public.cppbuilder.database.ado
Article #1553Newbie problems with ADODataSets
From: Martin Moeller
Date: Thu, 13 May 2004 20:23
Date: Thu, 13 May 2004 20:23
50 lines
2405 bytes
2405 bytes
Hi,
I have some newbie problems to get started with ADO components.
My MS ACCESS file has 3 tables, 1 fully hidden to the user, and 2 to be
partially edited by a DBGrid.
The component sequence is based on 1 ADOConnection and 3 ADODataSET, one for
each table. They activate at runtime loading the complete field
specifications by a SELECT * FROM <table_name> comand.
For the tables to allow partial editing, the sequence continues by a
TDataSetProvider, a TCustomDataSet with partial fields, a TDataSource and a
TDBGrig with persistent columns:
ADOConnection
|
-> ADODataSet2 (table2)
| |
| -> TDataSetProvider2
| |
| -> TCustomDataSet2
| |
| -> TDBGrid2 ( for table2)
|
|
-> ADODataSet3 (table3)
|
-> TDataSetProvider3
|
-> TCustomDataSet3
|
-> TDBGrid3 ( for table3)
The runtime activation works fine upto the ADODataSEt, but the Append() to
create a new/first record fails, or at least the RecordCount is always 0,
while the other relevant properties are all true (Active,CanModify etc) as
well as reporting correctly FieldCount.
SqlStr="SELECT * FROM MicList;";
AdsMicList->CommandText=SqlStr.c_bstr();
AdsMicList->Open();
AdsMicList->Append();
AdsMicList->FieldValues["NetId"]=4;
What might be wrong?
Tks & Rgds, Martin
Technical Details
Message-ID:
<40a3d929@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,7ff5c9fcd17bfab4,start X-Google-Attributes: gid10698b,public Reply-To: "Martin Moeller" <martin.moeller@moema.it> From: "Martin Moeller" <martin.moeller@moema.it> Newsgroups: borland.public.cppbuilder.database.ado Subject: Newbie problems with ADODataSets Date: Thu, 13 May 2004 22:23:05 +0200 Lines: 53 Organization: Moe.Ma Italiana Srl X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 213.45.0.185 Message-ID: <40a3d929@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1084479785 213.45.0.185 (13 May 2004 13:23:05 -0700) Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail