dbTalk Databases Forums  

copying btrieve file in API

comp.databases.btrieve comp.databases.btrieve


Discuss copying btrieve file in API in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tomek
 
Posts: n/a

Default copying btrieve file in API - 02-10-2004 , 01:43 AM






How from Visual Basic 6 copy whole btrieve file to another
(in DOS mode is commant "butil -copy file.btr file.btr")
How make the same from inside program (API 32 )

thanks for help




Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: copying btrieve file in API - 02-10-2004 , 07:01 AM






Tomek wrote:

Quote:
How from Visual Basic 6 copy whole btrieve file to another
(in DOS mode is commant "butil -copy file.btr file.btr")
How make the same from inside program (API 32 )
The BUTIL -COPY function is actually quite simple. Here's the logic if
you want to implement your own version:

Open SourceFile
Open DestFile
Status=StepFirst(SourceFile) [you could also use GetFirst(SourceFile,
Key 0)]
While (Status = 0)
Status=Insert(DestFile)
Status=StepNext(SourceFile)
WEnd

Of course, you may want some error handling around the Insert, and
perhaps a way to indicate the failure code if you run into any errors.
Also, you may wish to handle records larger than 64K, so you may need to
use chunking...

Or, you can just SHELL out to BUTIL, I suppose.
Goldstar Software Inc.
Building on Btrieve(R) for the Future(SM)
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Pervasive.SQL Service & Support Classes ***
Chicago: March, 2004: See our web site for details!




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.