Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Of STORES and Files
Tue, Dec 17 2013 5:30 PMPermanent Link

Jeff Cook

Aspect Systems Ltd

Avatar

Hi

I know how to create a STORE

e.g.
apmDM.EDBSession.Execute
               ('CREATE STORE "ExportFiles" AS LOCAL PATH
''ExportFilesStore''');

.... and I can use a SaveDialog to get the filename and path to where a file
needs to go.

And I can export my data to a STORE as I can't go directly to a
path/filename

e.g.
apmDM.EDBMemory.Execute('EXPORT TABLE "' + sTempFileName + '" TO "'
               + apmDM.EDBEngine.QuotedSQLStr
               (ExtractFileName(SaveDialog.FileName))
               + '" IN STORE "ExportFiles" '
               + sl.CommaText /* column names */
               + ' FORMAT DELIMITED INCLUDE HEADERS');

BUT how do I copy the file from a STORE to the path from my SaveDialog?

I suppose I could create a new STORE each time with the path from the
SaveDialog and drop the STORE without deleting the data.  In a multiuser
environment, I'd then have to create a unique STORE name for this process.

Is that the answer  or there a smarter way?

Also, with wider relevance, how do I know if a STORE already exists.  The
STORE is at a higher level than an individual database, so 'SELECT * FROM
Information.??? WHERE Name ..." isn't going to work.  Is there a
HigherInformation table hiding somewhere?

I could use a try/except block to detect an attempted duplicate "CREATE
STORE", but is there a nicer way?

Cheers

Jeff
--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz

Tue, Dec 17 2013 6:22 PMPermanent Link

Raul

Team Elevate Team Elevate

On 12/17/2013 5:30 PM, Jeff Cook wrote:
> Hi
> ... and I can use a SaveDialog to get the filename and path to where a file
> needs to go.
> BUT how do I copy the file from a STORE to the path from my SaveDialog?

Yes, you could create a new store or use SaveStoreFileToStream  and then
save to file.

Or if it is a local store then query the Configuration DB for the store
and path and copy the file using regular file copy methods.

> Also, with wider relevance, how do I know if a STORE already exists.  The
> STORE is at a higher level than an individual database, so 'SELECT * FROM
> Information.??? WHERE Name ..." isn't going to work.  Is there a
> HigherInformation table hiding somewhere?


You'd have to query Configuration database (Stores table):

http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Configuration_Database

Raul
Tue, Dec 17 2013 7:23 PMPermanent Link

Jeff Cook

Aspect Systems Ltd

Avatar

Thanks Raul


"Raul" <raul@removethis.raul.ca> wrote in message
news:4089EA7A-73AA-407C-B4B1-38056FBAD997@news.elevatesoft.com...
> Yes, you could create a new store or use SaveStoreFileToStream  and then
> save to file.

Save to stream then save the stream to a file - simple!

> Or if it is a local store then query the Configuration DB for the store
> and path and copy the file using regular file copy methods.
>
> You'd have to query Configuration database (Stores table):
>
> http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Configuration_Database
>

OK, great, now I'm off and running - I must have skipped this database when
reading up on EDB.  Heaps of good stuff in here.

Cheers

Jeff
--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz

Thu, Dec 19 2013 3:19 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jeff,

<< BUT how do I copy the file from a STORE to the path from my SaveDialog?
>>

Is the path always local on the client ?  If so, then you would use this
method:

http://www.elevatesoft.com/manual?action=viewmethod&id=edb2&product=delphi&version=7&comp=TEDBSession&method=SaveStoreFileToStream

The EDB Manager also has source code that even shows you how to do a "direct
edit" on a store file by saving the store file to the temp directory using
the above method, doing a checksum, shell-executing the file, re-doing the
checksum, and then saving the file back to the store on the EDB Server.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Dec 19 2013 4:48 PMPermanent Link

Jeff Cook

Aspect Systems Ltd

Avatar

Thanks Tim

All tidied up now.

Cheers

Jef
--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:E108D625-3767-48D8-9ED5-47A87614C26C@news.elevatesoft.com...
> Jeff,
>
> << BUT how do I copy the file from a STORE to the path from my SaveDialog?
> >>
>
> Is the path always local on the client ?  If so, then you would use this
> method:
>
> http://www.elevatesoft.com/manual?action=viewmethod&id=edb2&product=delphi&version=7&comp=TEDBSession&method=SaveStoreFileToStream
>
> The EDB Manager also has source code that even shows you how to do a
> "direct edit" on a store file by saving the store file to the temp
> directory using the above method, doing a checksum, shell-executing the
> file, re-doing the checksum, and then saving the file back to the store on
> the EDB Server.
>
> Tim Young
> Elevate Software
> www.elevatesoft.com

Image