Article View: borland.public.cppbuilder.database.ado
Article #1174Mater record missing
From: Merylene Vertue
Date: Tue, 19 Oct 2004 12:12
Date: Tue, 19 Oct 2004 12:12
35 lines
1897 bytes
1897 bytes
Got a simple project I've got a master detail relationship on a form, with a
datamodule (dml1)
Master
table: tblStudent
datasource:dsStudent
Detail
table:Parent
dtasource:dsParent
On the tblStudent (NewReocrd) if got the following code:
void __fastcall Tdml1::tblStudentNewRecord(TDataSet *DataSet)
{
tblNewStudent->Open();
try
{
tblNewStudent->Edit();
tblStudentStud_no->Value = tblNewStudentNewKey->Value;
tblNewStudentNewKey->Value = tblNewStudentNewKey->Value + 1;
tblNewStudent->Post();
tblNewStudent->Close();
}
catch(...)
{
tblNewStudent->Close();
}
tblStudentReg_Date->Value = Date();
}
As soon as I run the form and press the save button which post(); the
records it either gives a "tblParent not in insert or edit mode" or it
gives master reord missing.
I've made sure that on (activate) of the student form that it put the tables
open and insert mode and when I press the save button that it edit and post.
Technical Details
Message-ID:
<417504b8@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,30a3e78225fa1ce8,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Merylene Vertue" <merylenevertue@hotmail.com> From: "Merylene Vertue" <merylenevertue@hotmail.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: Mater record missing Date: Tue, 19 Oct 2004 14:12:44 +0200 Lines: 38 Organization: Private X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 155.239.168.133 Message-ID: <417504b8@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1098187960 155.239.168.133 (19 Oct 2004 05:12:40 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail