Board index » delphi » Copying ttable contents to the clipboard

Copying ttable contents to the clipboard

What would be the easiest way of copying the contents of a TTable component,
or sql component to the clipboard? I want to copy the contents to Excel
where the data will be posted and manipulated.
Any suggestions gratefully received.

thanx

Martin

 

Re:Copying ttable contents to the clipboard


Martin,

I have a question first: you want to copy the entire contents of
TTable-component to clipboard, and later on paste this in Excel. Excel has
some excellent features concerning databases. Why don't you use them
directly? Probably much quicker, and you don't consume so much memory.

The entire contents of your table could be very big. Don't wanna do that, I
think.

But to answer your question:

Excel understands some clipboard-formats, however I think you can only use
the Text-format. Excel does not have code to support a
custom-clipboard-format. So you must find a way to send your table contents
as text to the clipboard.

Maybe you can put your data in a stringlist, and write the entire contents
of the stringlist to the clipboard. Or you could use a TMemo, has a nice
CopyToClipboard procedure. Something like that, if you want to do it via
Delphi.

Sincerely,

Fred Jansma.

Quote
Martin Kellett wrote in message <6t1g95$f4...@plutonium.btinternet.com>...
>What would be the easiest way of copying the contents of a TTable

component,

Other Threads