🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Mater record missing

#767
From: James Peterson
Date: Fri, 08 Apr 2005 13:30
46 lines
2162 bytes
if you are inserting you want to use tblNewStudent->Insert();  this will
allow you to add records.

"Merylene Vertue" <merylenevertue@hotmail.com> wrote in message
news:417504b8@newsgroups.borland.com...
> 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: <4256877e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <417504b8@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,30a3e78225fa1ce8
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "James Peterson" <jpeterson@romanmealmilling.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <417504b8@newsgroups.borland.com>
Subject: Re: Mater record missing
Date: Fri, 8 Apr 2005 08:30:39 -0500
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 64.21.236.129
Message-ID: <4256877e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1112967038 64.21.236.129 (8 Apr 2005 06:30:38 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail