🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
4 messages
4 total messages Started by kubo Mon, 01 Oct 2007 12:16
DBGrid and Excel
#125
Author: kubo
Date: Mon, 01 Oct 2007 12:16
19 lines
1655 bytes
hi

this tread should help everyone who try work whit xls file like database table, and of course me with my problems do that :).
Im from Slovakia so i apologize for my lenguage.

OK so what i did and where i stuck.

1.) I create alias "ODBCLieky" to the xls file in ODBC
2.) I connect to ODBC by using ADOConnection and usin the ADOTable and DataSource and at last DBGrid.

ADOConnection1->ConnectionString=_T("DSN=ODBCLieky;Uid=;Pwd=;");
ADOTable1->Connection = ADOConnection1;
DataSource1->DataSet = ADOTable1;
DBGrid1->DataSource = DataSource1;

OK until now its ok, but here i have problem with the column names. When i read the data from xls file, the data in firs row are read as the colum name so i lost the firs record. How should i insert the whole data (whit the firs row) into corecrt column witch i chose.

thanks 2 all
Re: DBGrid and Excel
#126
Author: Daryl
Date: Tue, 02 Oct 2007 01:31
8 lines
1503 bytes
Kubo wrote:

> OK until now its ok, but here i have problem with the column names. When i 
> read the data from xls file, the data in firs row are read as the colum 
> name so i lost the firs record. How should i insert the whole data (whit 
> the firs row) into corecrt column witch i chose.

This link may help  http://support.microsoft.com/kb/288343
Re: DBGrid and Excel
#128
Author: kubo
Date: Thu, 11 Oct 2007 03:18
19 lines
1536 bytes
Great now i understandet the components how it should be connected
between there.
New problem which i have is where or how could i get the names of the
columns. I try some methods of the calss like ADOTable or DataSource,
but i can't find any.

please help

Daryl napsal(a):
> Kubo wrote:
> 
>> OK until now its ok, but here i have problem with the column names.
>> When i read the data from xls file, the data in firs row are read as
>> the colum name so i lost the firs record. How should i insert the
>> whole data (whit the firs row) into corecrt column witch i chose.
> 
> This link may help  http://support.microsoft.com/kb/288343
> 
> 
Re: DBGrid and Excel
#129
Author: kubo
Date: Thu, 11 Oct 2007 03:53
39 lines
2356 bytes
Great now i understandet the components how it should be connected
between there.
New problem which i have is where or how could i get the names of the
columns. I try some methods of the calss like ADOTable or DataSource,
but i can't find any.

Atctually how to create and fill the ADOTable fields with the
coresponding column names. I knowe how to do it in Fields editor window
but i need the code which i dont knowe. And then i need to put the names
into DBGrid, is the same i knowe how to do it in BDS Design but i need
it to write inside the code.

please help

Daryl napsal(a):
> Kubo wrote:
>
>> OK until now its ok, but here i have problem with the column names.
>> When i read the data from xls file, the data in firs row are read as
>> the colum name so i lost the firs record. How should i insert the
>> whole data (whit the firs row) into corecrt column witch i chose.
>
> This link may help  http://support.microsoft.com/kb/288343
>
>



Daryl napsal(a):
> Kubo wrote:
> 
>> OK until now its ok, but here i have problem with the column names.
>> When i read the data from xls file, the data in firs row are read as
>> the colum name so i lost the firs record. How should i insert the
>> whole data (whit the firs row) into corecrt column witch i chose.
> 
> This link may help  http://support.microsoft.com/kb/288343
> 
> 
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