Board index » delphi » Saving dataset to xls,mdb,foxpro

Saving dataset to xls,mdb,foxpro

Please somebody help me!
How can I save the data in Dataset to  odbc file format like *.xls(excel
files),*.mdb(access), or foxpro files on runtime?
Do I have to configure "Object DSN" in one of ODBC alias I've created? If
so, how to create and configure  that *.DSN in runtime (not by using 32 bit
ODBC in Control Panel).
 

Re:Saving dataset to xls,mdb,foxpro


Quote
>How can I save the data in Dataset to  odbc file format like *.xls(excel
>files),*.mdb(access), or foxpro files on runtime?

With Access you can use a batchmove component to copy data from one Ttable to a
destination Ttable.  The destination table needs to have an ODBC Alias (or
Tdatabase component) connected to an Access ODBC DSN.
I do not believe this works with Excel.  You may want to look at this URL for
information on working with Excel and Ole automation
http://www.inprise.com/delphi/papers/microexcel/

Quote
>Do I have to configure "Object DSN" in one of ODBC alias I've created? If
>so, how to create and configure  that *.DSN in runtime (not by using 32 bit
>ODBC in Control Panel).

DSNs are just a bunch of registry entries.  They differ for each ODBC driver but
what you need to do is create a DSN manually and then figure out which entries
it creates.  

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Saving dataset to xls,mdb,foxpro


With C++Builder 4 for Access you no longer need ODBC. Access is native driver
in BDE. For excell, you may create the table in Access format and call within
EXCELL. EXCELL will do the conversion for you, less risk and simpler, compared
with generating a .XLS file format.

Cheers

Quote
Jeffrey wrote:
> Please somebody help me!
> How can I save the data in Dataset to  odbc file format like *.xls(excel
> files),*.mdb(access), or foxpro files on runtime?
> Do I have to configure "Object DSN" in one of ODBC alias I've created? If
> so, how to create and configure  that *.DSN in runtime (not by using 32 bit
> ODBC in Control Panel).

  TrajanoRoberto.vcf
< 1K Download

Re:Saving dataset to xls,mdb,foxpro


Options:

1. Use TRegistry to add ODBC entries manually
2. Or import and use SQLConfigDataSource function

Then you can create a table in the target(connected to another TDataBase
component) and walk-append records with code or use TBatchMove to help.

Another possible option is to use OLE automation.

hth
-Sen

Jeffrey <p...@bdg.starindo.net> wrote in article
<7amnvf$i...@forums.borland.com>...

Quote
> Please somebody help me!
> How can I save the data in Dataset to  odbc file format like *.xls(excel
> files),*.mdb(access), or foxpro files on runtime?
> Do I have to configure "Object DSN" in one of ODBC alias I've created? If
> so, how to create and configure  that *.DSN in runtime (not by using 32
bit
> ODBC in Control Panel).

Re:Saving dataset to xls,mdb,foxpro


Quote
Trajano Roberto wrote in message <36CF88CA.511FB...@netscape.net>...
>With C++Builder 4 for Access you no longer need ODBC. Access is native
>driver
>in BDE. For excell, you may create the table in Access format and call
>within
>EXCELL. EXCELL will do the conversion for you, less risk and simpler,
>compared
>with generating a .XLS file format.

EXCELL. EXCELL? Would you mind discribing it more clearly?

Re:Saving dataset to xls,mdb,foxpro


Quote
Brian Bushay TeamB wrote in message <36d16d32.42469649@floyd>...
>With Access you can use a batchmove component to copy data from one Ttable
to a
>destination Ttable.  The destination table needs to have an ODBC Alias (or
>Tdatabase component) connected to an Access ODBC DSN.

That's my problem! I can't figure out how to configure that ODBC alias so I
can create mdb files in different path and different directory in runtime.

Quote
>I do not believe this works with Excel.
>You may want to look at this URL for
>information on working with Excel and Ole automation
>http://www.inprise.com/delphi/papers/microexcel/

I have read that paper, but the result is too slow for a large table.

Re:Saving dataset to xls,mdb,foxpro


Quote

>That's my problem! I can't figure out how to configure that ODBC alias so I
>can create mdb files in different path and different directory in runtime.

You will have to create the DSN.  An Alias to an ODBC database can only use the
directory set up in the DSN.   A DSN is just a few entries in the Registry so
you should be able to figure out how to code that.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Saving dataset to xls,mdb,foxpro


Quote
 Trajano Roberto wrote:
>With C++Builder 4 for Access you no longer need ODBC. Access is native driver in BDE.

Access is a native driver even in CBuilder 3 Pro, but I have to
install a MS-product (Acces or Excel) in order to use my application,
or i have to purchase a copy of MS-ADT!  The DBE-Access driver need
DAO and the Jet engine: I have to sell MS-Office to my customers?:-(
I am mistaking? Something is changed in version 4?

There is a question in my mind: if I use ODBC it's more easy to
distribute my Access-based application even if my customers don't have
a MS-application?

I'm thinking...
Athos.
Athos Antonelli, working with C++ since 1990 and now in C++Builder!
at...@mail.compy-net.com
http://LittleItaly.FortuneCity.com/Cesena/204

Other Threads