Article View: borland.public.cppbuilder.database.ado
Article #1454Re: Selecting data from an Excel spreadsheet into a database table.
From: Peter Nunn
Date: Wed, 16 Jun 2004 01:22
Date: Wed, 16 Jun 2004 01:22
73 lines
3069 bytes
3069 bytes
Vassiliev, thanks for the help. I removed all the extra parameters that were inserted by the build connection string wizard to the miminum ones you have here and used Select * from [Sheet1$] (not [$Sheet1] as you had it) and all is well. Thanks again for the input. Peter Nunn. On Mon, 14 Jun 2004 17:03:17 +0400, "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote: >$ is special sign, use: > >From sheet: > >Select * from [$Sheet1] > >From named diapason: > >Select * from [DiapasonName] > >From range: > >Select * from [Sheet1$B5:C10] > >Use also Jet provider. Connection string is: > >Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.xls;Extended >properties=Excel 8.0; > >//------------------------------------------ >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) > >"Peter Nunn" <pnunn@infoteq.com.au> ???????/???????? ? ???????? ?????????: >news:bo3rc0defgrbhs3covm9ld7sv9r9s3ke9i@4ax.com... >> Hi folks, >> >> I'm struggling with an app in which I need to update a database with >> data stored in an Excel spreadsheet. >> >> I've done a bit of hunting around on the net and it seems that some >> sort of ODBC connection would be the best way to do this (easier than >> parsing the spread sheet line by line) but I can't seem to get it to >> work for me. >> >> I've setup a system DSN for the spreadsheet (although it would be nice >> not to have to do this), pointed a TADOConnection compenonent to that >> and set active true (so far so good). >> >> When I add a TADOTable however and connect that to the ADOConnection I >> don't see any of the workbooks in the table list. >> >> I tried adding Sheet1$ to the table name (from the net) but when I set >> active here I get an error >> >> Syntax error in from clause. >> >> Any ideas what I should be doing please? >> >> ta. >> Peter. >> >
Technical Details
Message-ID:
<c38vc0tp38t2to1vr4cheqsjcftstgmq4j@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newshosting.com!nx01.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<bo3rc0defgrbhs3covm9ld7sv9r9s3ke9i@4ax.com> <40cda214@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,2eabea38f2dfa61 X-Google-Attributes: gid10698b,public From: Peter Nunn <pnunn@infoteq.com.au> Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: Selecting data from an Excel spreadsheet into a database table. Date: Wed, 16 Jun 2004 11:22:02 +1000 Organization: Infoteq P/L Reply-To: pnunn@Infoteq.com.au Message-ID: <c38vc0tp38t2to1vr4cheqsjcftstgmq4j@4ax.com> References: <bo3rc0defgrbhs3covm9ld7sv9r9s3ke9i@4ax.com> <40cda214@newsgroups.borland.com> X-Newsreader: Forte Agent 2.0/32.646 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 203.113.216.18 X-Trace: newsgroups.borland.com 1087350013 203.113.216.18 (15 Jun 2004 18:40:13 -0700) Lines: 74 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newshosting.com!nx01.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail