🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Adding new entries to table...

#3510
From: Jerry Irons
Date: Fri, 16 Aug 2002 15:19
57 lines
2454 bytes
Hi Stan,

Use tdaodataset - generally works faster.

You can use an sql query to suck up the text file and insert into your
table.  You can also do this:

Assuming, commandtype tabledirect

TADoDataset->Insert();
TADODataset->FieldByName("LastName")->AsString = "Smith"  // or text
...
...
...
TADODataset->Post();

Autoincrement field takes care of itself.

-Jerry




On Wed, 7 Aug 2002 18:50:55 -0700, "John Romow" <holjar@masen.net>
wrote:

>Hi. I have a rather simple MS Access mdb with 3 tables, and I'm working
>with just one of the tables. I managed to figure out how ot open it
>(ahem, "connect" to it that is) with a TADOConnection and now I'm trying
>to use a TADOTable to add entries. The table connects ok (I have the
>Connection property set to the TADOConnection adn I can select the table
>I want.
>
>My question is: how can I add entries (I have them stored in a text
>file - a list of last and first names that I want to stick into my
>table).
>
>I've looked through the help but I keep getting stuck. I admit I'm
>rather new to working wth DBs in BCB (but not new to BCB!).
>
>Here are the Fields in my table:
>
>| ID | Last Name | First Name | Email |
>
>(I'm only working with the middle two)
>
>And one more note, ID is an AutoNumber field, so will BCB take that into
>account?
>
>Thanks a lot here, I am getting desperate, as I've been trying for about
>a week on my own here, looking through the help file and all. I even
>tried Google too.
>
>Thanks
>
>~ Stan
>
Technical Details
Message-ID: <2l3qluobfi0285q7q3naj634neb5lpj59t@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail
References: <3d51cd73$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,d2324469848aff7e,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-08-16 08:38:47 PST
From: Jerry Irons <JIrons@compuserve.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Adding new entries to table...
Date: Fri, 16 Aug 2002 11:19:20 -0400
Message-ID: <2l3qluobfi0285q7q3naj634neb5lpj59t@4ax.com>
References: <3d51cd73$1_1@dnews>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.54.9.179
X-Trace: dnews 1029511216 24.54.9.179 (16 Aug 2002 08:20:16 -0700)
Lines: 58
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail