🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

DBGrid and Excel

#125
From: 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
Technical Details
Message-ID: <4700e523$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,25aa1d540aa248f4,start
X-Google-Attributes: gid10698b,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "kubo" <kubisow@gmail.com>
Sender: "kubo" <kubisow@gmail.com>
Reply-To: "kubo" <kubisow@gmail.com>
Subject: DBGrid and Excel
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 89.233.175.54     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4700e523$1@newsgroups.borland.com>
Date: 1 Oct 2007 05:16:35 -0700
X-Trace: newsgroups.borland.com 1191240995 207.105.83.66 (1 Oct 2007 05:16:35 -0700)
Lines: 19
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail