Article View: borland.public.cppbuilder.database.ado
Article #3621Re: Excell into DBGrid
From: Shaun
Date: Sat, 20 Jul 2002 07:40
Date: Sat, 20 Jul 2002 07:40
28 lines
1824 bytes
1824 bytes
Hi Carlos, this may help. I used CBuilder4 pro and Excel 97 drop a TQuery, TDBGrid and a TDataSource on a form. Set up your ODBC connection to point at your spreadsheet. (I used a system level DSN) In the Object Inspector ------------------------ Datasource1->Dataset = Query1 DBGrid1->Datasource = Datasource1 Query1->DatabaseName = [YOUR ODBC DSN ENTRY SHOULD BE IN THIS LIST] Query1->SQL = "SELECT * FROM [SHEET1$]" Query1->Active = True Sheet1 being the name of the relevant sheet in your spreadsheet, always follow the worksheet name with a $ sign and you will need the square brackets for Borland's SQL builder. This is of course using the BDE. I am still trying to get Cbuilder to connect to Excel with Adodb, which is a better solution, I have however, been frustrated to this point in my attempts, so much so, I wrote the application I needed in VB6. regards Shaun
Technical Details
Message-ID:
<3d390f83$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!feed.textport.net!news.stealth.net!news.stealth.net!opentransit.net!proxad.net!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3d36ec85$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,983cdea16fea9622 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-07-20 00:34:33 PST From: "Shaun" <nospam@nospam.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3d36ec85$1_1@dnews> Subject: Re: Excell into DBGrid Date: Sat, 20 Jul 2002 19:40:54 +1200 Lines: 30 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 202.50.240.50 Message-ID: <3d390f83$1_2@dnews> X-Trace: dnews 1027149699 202.50.240.50 (20 Jul 2002 00:21:39 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!feed.textport.net!news.stealth.net!news.stealth.net!opentransit.net!proxad.net!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews