🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages Started by Mario Sun, 05 Mar 2006 12:46
Reading data from Access DB
#436
Author: Mario
Date: Sun, 05 Mar 2006 12:46
14 lines
1567 bytes
I'm working on an app that needs to read data from an Access database, 
apply some conversions to all the data and write it out to a comma 
delimited file. My plan was to open the Access database and put it into 
a TDBGrid object so I could walk through each cell with the Col and Row 
properties. Unfortunately, these properties are protected so they are 
not available to the main form where the conversion method is located.

So, before I get hoplessly lost with this, is there a better way to do 
what I'm trying to do? Any help would be appreciated.

I'm a bit rusty with C++, but it's coming back, and I'm new to C++ 
Builder 2006 so please go easy on me...

Mario
Re: Reading data from Access DB
#437
Author: Viatcheslav V. Vassiliev
Date: Mon, 06 Mar 2006 07:50
36 lines
2275 bytes
Use TDataSet (TADODataSet) without TDBGrid:

while (!DataSet1->Eof)
{
  for (int i = 0; i < DataSet1->Fields->Count; i++)
  {
    ... DataSet1->Fields->Fields[i]->AsString ...
  }

  DataSet1->Next();
}

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Mario" <junk@L4software.com> ???????/???????? ? ???????? ?????????: 
news:440adda9$1@newsgroups.borland.com...
> I'm working on an app that needs to read data from an Access database, 
> apply some conversions to all the data and write it out to a comma 
> delimited file. My plan was to open the Access database and put it into a 
> TDBGrid object so I could walk through each cell with the Col and Row 
> properties. Unfortunately, these properties are protected so they are not 
> available to the main form where the conversion method is located.
>
> So, before I get hoplessly lost with this, is there a better way to do 
> what I'm trying to do? Any help would be appreciated.
>
> I'm a bit rusty with C++, but it's coming back, and I'm new to C++ Builder 
> 2006 so please go easy on me...
>
> Mario 
Re: Reading data from Access DB
#439
Author: Mario
Date: Mon, 06 Mar 2006 13:12
16 lines
1321 bytes
That's exactly what I needed. Thanks a lot.

Mario

Viatcheslav V. Vassiliev wrote:
> Use TDataSet (TADODataSet) without TDBGrid:
> 
> while (!DataSet1->Eof)
> {
>   for (int i = 0; i < DataSet1->Fields->Count; i++)
>   {
>     ... DataSet1->Fields->Fields[i]->AsString ...
>   }
> 
>   DataSet1->Next();
> }
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads