Board index » delphi » Delphi5 & SQL Server Table Export

Delphi5 & SQL Server Table Export

Hi,

In Delphi, how does one export an SQL Server table to the user's a: drive?

TIA,
Pam

 

Re:Delphi5 & SQL Server Table Export


In what format do you want to save the data on the a: drive? Excel, csv,
txt, etc.?

--

Alain Quesnel
cinqsanss...@compuserve.com

Quote
"Pam" <parke...@zdnetonebox.com> wrote in message news:3a86c52c_1@dnews...
> Hi,

> In Delphi, how does one export an SQL Server table to the user's a: drive?

> TIA,
> Pam

Re:Delphi5 & SQL Server Table Export


I think as a text file.  I'm translating this application from Paradox-based
to SQL Server-based.  The previous version just saved the table as a .db
file.  Is there a way to save it in table format?

Quote
"Alain Quesnel" <cinqsanss...@compuserve.com> wrote in message

news:3a86f38a$1_1@dnews...
Quote
> In what format do you want to save the data on the a: drive? Excel, csv,
> txt, etc.?

> --

> Alain Quesnel
> cinqsanss...@compuserve.com

> "Pam" <parke...@zdnetonebox.com> wrote in message news:3a86c52c_1@dnews...
> > Hi,

> > In Delphi, how does one export an SQL Server table to the user's a:
drive?

> > TIA,
> > Pam

Re:Delphi5 & SQL Server Table Export


In my experience, a good way is teach the users how to get data from the
Server va Excel\Data\Obtain external data.
THis way result very usefull to them because they not need me every time to
extract and manipulate data (Read only of course).
Quote
Pam wrote:
> Hi,

> In Delphi, how does one export an SQL Server table to the user's a: drive?

> TIA,
> Pam

Re:Delphi5 & SQL Server Table Export


That makes perfect sense, but in this instance, I need to be able to do it
programmatically.  Is there an easy way to do this?

Quote
"Pablo Gietz" <gietz...@arnet.com.ar> wrote in message

news:3A87D7A3.BD59EC51@arnet.com.ar...
Quote
> In my experience, a good way is teach the users how to get data from the
> Server va Excel\Data\Obtain external data.
> THis way result very usefull to them because they not need me every time
to
> extract and manipulate data (Read only of course).

> Pam wrote:

> > Hi,

> > In Delphi, how does one export an SQL Server table to the user's a:
drive?

> > TIA,
> > Pam

Re:Delphi5 & SQL Server Table Export


One way, is too get a grid that exports to different formats.  So all you
have to do is to bind the grid to a datasource and then export.

Edwin

Quote
"Pam" <parke...@zdnetonebox.com> wrote in message news:3a86c52c_1@dnews...
> Hi,

> In Delphi, how does one export an SQL Server table to the user's a: drive?

> TIA,
> Pam

Re:Delphi5 & SQL Server Table Export


Good suggestion, but which components do I need to use to export an SQL
Server table in Delphi?

Quote
"Edwin Walker" <ewal...@summitnational.com> wrote in message

news:3a880168_2@dnews...
Quote
> One way, is too get a grid that exports to different formats.  So all you
> have to do is to bind the grid to a datasource and then export.

> Edwin

> "Pam" <parke...@zdnetonebox.com> wrote in message news:3a86c52c_1@dnews...
> > Hi,

> > In Delphi, how does one export an SQL Server table to the user's a:
drive?

> > TIA,
> > Pam

Re:Delphi5 & SQL Server Table Export


I just went to www.delphipages.com and search for 'grid export' and found a
couple.  I sure www.torry.net has some also.

SMExport suite v3.70 looks interesting.

Edwin

Quote
"Pam" <parke...@zdnetonebox.com> wrote in message news:3a884fef$1_2@dnews...
> Good suggestion, but which components do I need to use to export an SQL
> Server table in Delphi?

> "Edwin Walker" <ewal...@summitnational.com> wrote in message
> news:3a880168_2@dnews...
> > One way, is too get a grid that exports to different formats.  So all
you
> > have to do is to bind the grid to a datasource and then export.

> > Edwin

> > "Pam" <parke...@zdnetonebox.com> wrote in message

news:3a86c52c_1@dnews...
Quote
> > > Hi,

> > > In Delphi, how does one export an SQL Server table to the user's a:
> drive?

> > > TIA,
> > > Pam

Re:Delphi5 & SQL Server Table Export


You can use Quick reports to export your data to text, just create a detail
band an add the fields you wish to export, no headers, no groups and use the
ExportToFilter method

--
Ing. Eduardo Martinez Ocampo
Chief of Information Systems
Industria Envasadora de Queretaro, S.A, de C.V.
"The Coca-Cola Canning Plant"
Queretaro, Qro Mexico

Re:Delphi5 & SQL Server Table Export


Have a look at TClientDataSet

Pam a crit dans le message <3a86c52c_1@dnews>...

Quote
>Hi,

>In Delphi, how does one export an SQL Server table to the user's a: drive?

>TIA,
>Pam

Re:Delphi5 & SQL Server Table Export


Pam,

First, what SQL server are you using?

If it is MS-SQL Server then you can by using the enterprise manager do that
export once and then totally automate it on a scheduler or on demand. You
may also want to look at DTS. They let you save your export into almost any
format that you have an ODBC driver for and again you can save your export
as a template that can be called or scheduled again and again.

If it is Interbase, there is a command line tool that will do this for you.
Automated job processing and so on are not Interbase's strong suits so you
kind of have to find some makeshift solution somewhere out there. I am sure
that you will find something.

If it is Oracle, you can write a stored procedure that will write the file
out to disk This can then be automated using an Oracle Job. If you need to
send the export file out to a client machine then I have written a command
line utility (somewhere around here..) that will do it for you. You can call
it from a scheduler program if you wish and it can do multiple table exports
per run(No, I do not charge for it).

The general rule of thumb for doing exports has been to avoid as much if not
all human intervention in the process.

Good Luck.

Quote
"Pam" <parke...@zdnetonebox.com> wrote in message news:3a86c52c_1@dnews...
> Hi,

> In Delphi, how does one export an SQL Server table to the user's a: drive?

> TIA,
> Pam

Re:Delphi5 & SQL Server Table Export


Stimpy,

Thank you so much for all your assistance!!

Using MS SQL Server 7, I successfully created a .dts file that exports one
table to a comma-delimited text file.  Since it is saved with a .dts
extension, how do I execute it in Delphi??  Do I need to use OLE?  If so,
how (I have no experience with that)?

Thanks again!!
Pam

Quote
"Stimpy" <stim...@linkline.com> wrote in message

news:96fkrv$nr51@bornews.inprise.com...
Quote
> Pam,

> First, what SQL server are you using?

> If it is MS-SQL Server then you can by using the enterprise manager do
that
> export once and then totally automate it on a scheduler or on demand. You
> may also want to look at DTS. They let you save your export into almost
any
> format that you have an ODBC driver for and again you can save your export
> as a template that can be called or scheduled again and again.

> If it is Interbase, there is a command line tool that will do this for
you.
> Automated job processing and so on are not Interbase's strong suits so you
> kind of have to find some makeshift solution somewhere out there. I am
sure
> that you will find something.

> If it is Oracle, you can write a stored procedure that will write the file
> out to disk This can then be automated using an Oracle Job. If you need to
> send the export file out to a client machine then I have written a command
> line utility (somewhere around here..) that will do it for you. You can
call
> it from a scheduler program if you wish and it can do multiple table
exports
> per run(No, I do not charge for it).

> The general rule of thumb for doing exports has been to avoid as much if
not
> all human intervention in the process.

> Good Luck.

> "Pam" <parke...@zdnetonebox.com> wrote in message news:3a86c52c_1@dnews...
> > Hi,

> > In Delphi, how does one export an SQL Server table to the user's a:
drive?

> > TIA,
> > Pam

Re:Delphi5 & SQL Server Table Export


COM (OLE) is one way to do this, you can also just use DTSRun, you can just
call this from createprocess.

-Euan

Quote
"Pam" <parke...@zdnetonebox.com> wrote in message news:3a8be013_2@dnews...
> Stimpy,

> Thank you so much for all your assistance!!

> Using MS SQL Server 7, I successfully created a .dts file that exports one
> table to a comma-delimited text file.  Since it is saved with a .dts
> extension, how do I execute it in Delphi??  Do I need to use OLE?  If so,
> how (I have no experience with that)?

> Thanks again!!
> Pam

> "Stimpy" <stim...@linkline.com> wrote in message
> news:96fkrv$nr51@bornews.inprise.com...
> > Pam,

> > First, what SQL server are you using?

> > If it is MS-SQL Server then you can by using the enterprise manager do
> that
> > export once and then totally automate it on a scheduler or on demand.
You
> > may also want to look at DTS. They let you save your export into almost
> any
> > format that you have an ODBC driver for and again you can save your
export
> > as a template that can be called or scheduled again and again.

> > If it is Interbase, there is a command line tool that will do this for
> you.
> > Automated job processing and so on are not Interbase's strong suits so
you
> > kind of have to find some makeshift solution somewhere out there. I am
> sure
> > that you will find something.

> > If it is Oracle, you can write a stored procedure that will write the
file
> > out to disk This can then be automated using an Oracle Job. If you need
to
> > send the export file out to a client machine then I have written a
command
> > line utility (somewhere around here..) that will do it for you. You can
> call
> > it from a scheduler program if you wish and it can do multiple table
> exports
> > per run(No, I do not charge for it).

> > The general rule of thumb for doing exports has been to avoid as much if
> not
> > all human intervention in the process.

> > Good Luck.

> > "Pam" <parke...@zdnetonebox.com> wrote in message

news:3a86c52c_1@dnews...

- Show quoted text -

Quote
> > > Hi,

> > > In Delphi, how does one export an SQL Server table to the user's a:
> drive?

> > > TIA,
> > > Pam

Re:Delphi5 & SQL Server Table Export


Hi Pam,

It is possible to write a stored procedure that will execute a DTS package.
So your D5 app could call the stored procedure that will in turn execute the
DTS package.

Let me know if you would like more information on how to do this.

Richard.

Quote
"Pam" <parke...@zdnetonebox.com> wrote in message news:3a8be013_2@dnews...
> Stimpy,

> Thank you so much for all your assistance!!

> Using MS SQL Server 7, I successfully created a .dts file that exports one
> table to a comma-delimited text file.  Since it is saved with a .dts
> extension, how do I execute it in Delphi??  Do I need to use OLE?  If so,
> how (I have no experience with that)?

> Thanks again!!
> Pam

> "Stimpy" <stim...@linkline.com> wrote in message
> news:96fkrv$nr51@bornews.inprise.com...
> > Pam,

> > First, what SQL server are you using?

> > If it is MS-SQL Server then you can by using the enterprise manager do
> that
> > export once and then totally automate it on a scheduler or on demand.
You
> > may also want to look at DTS. They let you save your export into almost
> any
> > format that you have an ODBC driver for and again you can save your
export
> > as a template that can be called or scheduled again and again.

> > If it is Interbase, there is a command line tool that will do this for
> you.
> > Automated job processing and so on are not Interbase's strong suits so
you
> > kind of have to find some makeshift solution somewhere out there. I am
> sure
> > that you will find something.

> > If it is Oracle, you can write a stored procedure that will write the
file
> > out to disk This can then be automated using an Oracle Job. If you need
to
> > send the export file out to a client machine then I have written a
command
> > line utility (somewhere around here..) that will do it for you. You can
> call
> > it from a scheduler program if you wish and it can do multiple table
> exports
> > per run(No, I do not charge for it).

> > The general rule of thumb for doing exports has been to avoid as much if
> not
> > all human intervention in the process.

> > Good Luck.

> > "Pam" <parke...@zdnetonebox.com> wrote in message

news:3a86c52c_1@dnews...

- Show quoted text -

Quote
> > > Hi,

> > > In Delphi, how does one export an SQL Server table to the user's a:
> drive?

> > > TIA,
> > > Pam

Re:Delphi5 & SQL Server Table Export


using adoexpress, use the GetStrings method of the recordset object, assign
the result to a stringlist and use savetofile

http://msdn.microsoft.com/library/psdk/dasdk/mdam10j3.htm

the string format only has one meaningful value : 2
eg
getString(2,0,#9,#13#10,'Null')

Other Threads