Board index » delphi » Import/Export from/to Word/Excel

Import/Export from/to Word/Excel

Hi,
Is it possible to import/export data from MS Word/Excel to/from InterBase
(6)? Using Delphi as dev. tool.
How?

Thanks in advance,
Tove

 

Re:Import/Export from/to Word/Excel


Hi,
I don't know about Delphi, but Excel and Word can use ODBC to connect to and
manipulate a database. First of all, you should install an ODBC driver for
InterBase. Second, read about how to work with ODBC within Excel.
Here is an example, it is part of my macros:
...
    With ActiveSheet.QueryTables.Add(Connection:= _
        "ODBC;DSN=your ODBC driver alias;UID=your login;PWD=your password", _

        Destination:=Range("A1"))
        .Sql = Array("SELECT * FROM your table")
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = True
        .SaveData = True
        .Refresh BackgroundQuery:=False
    End With
...

With best regards.
Sergey.

Other Threads