Board index » delphi » Importing from Excel to Interbase

Importing from Excel to Interbase

Hi,

We have numerous Excel spreadsheets, most have multiple worksheets
within them. We need to import this data to (one) IB table. So far, I
have not seen a (freeware) tool to do this.

The tools I have tried couldn't recognise the individual sheets. The
Excel file is always setup as a DSN with the ODBC Administrator. I can
see the setup in BDE Admin, but only when I access the BDE from
Delphi, can I see anything within the Excel file, that resembles the
sheet name. The sheet name may be ONP, and I _think_ from Delphi, it
showed the name as $ONP.  However, just accessing the BDE directly
does not display the additional information.

Have done some research, and a few posts were mentioning the problem
is that the sheets within the Excel file are recognised by Delphi as
system tables, and therefore not shown.

We only have 4 Excel files, but there are many sheets within each
file, so I do not want to have to export to CSV, or some other crude
(manual) method. Surely it can be done in Delphi somehow.

There are possibly an additional 100 to 150 Excel files, all most
likely with multiple sheets and multiple formats within each sheet.
How can I do this "cleanly" in Delphi, and pump the records into
Interbase ?

Which reminds me, when I trialled the Delphi 5 Enterprise, there was a
Borland datapump included. Now that I have purchased D6 Pro, I don't
see a datapump ?

Thanks,

Peter

 

Re:Importing from Excel to Interbase


You should be able to use ether ODBC or ADO to access the Excel data. Use
the worksheet name with a $ appended. You can also include a cell range, for
example Sheet1$A1:C40. You can also use a named range in place of the sheet
name. Both techniques work with both ADO and ODBC/BDE. A third alternative
is to open the Excel workbook via Automation and extract the data.

--
Bill
(TeamB cannot answer questions received via email)

Re:Importing from Excel to Interbase


Greetings,

    You can use VBA in Excell to export Excell data to IB. If you need help
with it contact me.

    HTH,
    Marcio Wesley Borges
    www.sibprovider.com

"Peter Richards" <jehos...@my-deja.com> escreveu na mensagem
news:3bafd303.7081538@207.105.83.65...

Quote
> Hi,

> We have numerous Excel spreadsheets, most have multiple worksheets
> within them. We need to import this data to (one) IB table. So far, I
> have not seen a (freeware) tool to do this.

> The tools I have tried couldn't recognise the individual sheets. The
> Excel file is always setup as a DSN with the ODBC Administrator. I can
> see the setup in BDE Admin, but only when I access the BDE from
> Delphi, can I see anything within the Excel file, that resembles the
> sheet name. The sheet name may be ONP, and I _think_ from Delphi, it
> showed the name as $ONP.  However, just accessing the BDE directly
> does not display the additional information.

> Have done some research, and a few posts were mentioning the problem
> is that the sheets within the Excel file are recognised by Delphi as
> system tables, and therefore not shown.

> We only have 4 Excel files, but there are many sheets within each
> file, so I do not want to have to export to CSV, or some other crude
> (manual) method. Surely it can be done in Delphi somehow.

> There are possibly an additional 100 to 150 Excel files, all most
> likely with multiple sheets and multiple formats within each sheet.
> How can I do this "cleanly" in Delphi, and pump the records into
> Interbase ?

> Which reminds me, when I trialled the Delphi 5 Enterprise, there was a
> Borland datapump included. Now that I have purchased D6 Pro, I don't
> see a datapump ?

> Thanks,

> Peter

Re:Importing from Excel to Interbase


Hi Bill,

On Mon, 24 Sep 2001 19:25:01 -0700, "Bill Todd \(TeamB\)"

Quote
<bill.nos...@dbginc.com> wrote:
>You should be able to use ether ODBC or ADO to access the Excel data. Use
>the worksheet name with a $ appended. You can also include a cell range, for
>example Sheet1$A1:C40. You can also use a named range in place of the sheet
>name. Both techniques work with both ADO and ODBC/BDE. A third alternative
>is to open the Excel workbook via Automation and extract the data.

There is probably an example of this sort in the DEMOS folder I guess.

Thanks

Peter

Re:Importing from Excel to Interbase


There are no examples the come with Delphi that I know of but it is pretty
straightforward. If you have a problem getting it to work reply to this
thread and I will try to help you.

--
Bill
(TeamB cannot answer questions received via email)

Other Threads