Article View: borland.public.cppbuilder.database.ado
Article #2053Re: Borland C++ ADO example/tutorial
From: Alen Markov
Date: Mon, 24 Nov 2003 19:30
Date: Mon, 24 Nov 2003 19:30
79 lines
3777 bytes
3777 bytes
Hello Marcel
If you're using BCB5 (not sure how it looks like in newer Versions)
//Connecting to the mdb-File
1.) Create an Acces Table which has a few columns so you have a *.mdb-File
2.) From the tab "ADO" drag the "ADOQuery" to your form, with that one we'll
connect to the mdb-File
3.) In the Properties for that ADOQuery click on ConnectionString, on the
right
side you'll see "..." appearing. Click on that "...".
4.) Select "Use Connection String" and then click on the button "Build"
5.) Select the tab "Provider" and select there the "Microsoft Jet 4.0 OLE DB
Provider
6.) Click back on the tab Connection and select your database *.mdb-File
(User name: Admin, check "Blank password). Confirm everything with OK
7.) Select now the property "SQL" of "ADQuery", click on that "..." so you
have
the Window "String List Editor" infront of you. Here enter by hand your
SQL-String,
for example:
SELECT * FROM YOURTABLE
and confirm with OK
//Accessing the mdb-File
8.) From the tab "Data Access" drag a "DataSource" on your Form
9.) In the properties of DataAccess have a look at DataSet and select the
"ADOQuery" as DataSet
10.) From the tab "DataControls" drag a "DBGrid" on your Form
11.) For the Property "DataSource" of DBGrid select the "DataSource"
that you just dragged before on your Form
12.) Select now again your "DataSource" component and set the property
"Enabled" to "true"
The DBGrid will now display your Access Table - you can directly write
into it and modify your table like that...
If anybody has a suggestion as a startpoint for information about ADO, plz
let me know too...
I also need to know how to crate a table directly by code, how to add a row,
how to write directly into a cell and like that... - please also have at my
next post
which will follow right after this one, thanks...
Cheers
Alen
--
WEB: http://www.come.to/nostromo
"Marcel" <neegeenspam@hotentottententententoonstellingen.nl> wrote in
message news:3fb9e3a8@newsgroups.borland.com...
> Hello all,
>
> I was searching the web yesterday but i didn't find a good tutorial of how
> to build a database application using Borland C++ Builder.
>
> I am new to C++, i am reading the book Accelerated C++ now as a start,
> meanwhile i am trying to explore BCB and i like to do some experiments.
> Yesterday i made a very simple table in an access database. I tried to
> connect to it using the ADO Connection component, then i dragged a ADO
> DataSet on the form which i tried to configure to use my datasource. But
> there it went wrong and i didn't figure it out till now. So do someone out
> there knows a good tutorial (dealing with ADO in conjunction with an
access
> database) besides the tutorial in the help files of BCB?
>
> Thanks in advance...
>
> Marcel
>
>
Technical Details
Message-ID:
<3fc25c04$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fb9e3a8@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,9f05c982b8d2d66b X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-11-24 11:40:26 PST From: "Alen Markov" <NOSPAM_amarkov@gmx.net> Newsgroups: borland.public.cppbuilder.database.ado References: <3fb9e3a8@newsgroups.borland.com> Subject: Re: Borland C++ ADO example/tutorial Date: Mon, 24 Nov 2003 20:30:51 +0100 Lines: 81 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 217.162.156.2 Message-ID: <3fc25c04$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069702148 217.162.156.2 (24 Nov 2003 11:29:08 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail