Article View: borland.public.cppbuilder.database.ado
Article #3758Re: Accessing a database without a form
From: MarkR
Date: Wed, 19 Jun 2002 00:28
Date: Wed, 19 Jun 2002 00:28
35 lines
1893 bytes
1893 bytes
You could create the vcl components on the fly, for example...
int RecordMax()
{
int nWork;
TQuery *qryTemp = new TQuery(this); // Create on the fly TQuery object
qryTemp->SQL->Add(" SELECT MAX((LeftCaliper) nVar from 'calipers.db' ");
// Add a simple statement
qryTemp->Open(); // Execute the statement (this is a return type query,
we expect one row)
nWork = qryTemp->FieldByName("nVar")->AsInteger; // Use a temp variable
to get the value of highest record number
qryTemp->Close(); // Close query, we have the value
delete qryTemp; // Clean up!
return nWork; // Reutrn control to calling function with max record
}
hope this helps,
Regards Mark
"Ferran Barba" <reg@sifbm.com> wrote in message news:3d0fbf45_2@dnews...
> Hi,
>
> I'm new to BCB, coming from VB. I want to access (read, write, ...) an
> Access database WITHOUT using a form, like when using DAO/ADO objects in
VB.
> How can this be done?
>
> Thanks in advance.
>
> Ferran Barba
>
>
>
Technical Details
Message-ID:
<3d0fd006$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3d0fbf45_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,5438de8422c49d3 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-06-18 17:30:54 PST From: "MarkR" <mark.richards8@wapthespamntlworld.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3d0fbf45_2@dnews> Subject: Re: Accessing a database without a form Date: Wed, 19 Jun 2002 01:28:55 +0100 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 213.107.139.203 Message-ID: <3d0fd006$1_2@dnews> X-Trace: dnews 1024446470 213.107.139.203 (18 Jun 2002 17:27:50 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews