Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Articles
Search: 

Online database backups
Cetin Basoz, January 6, 1998
Databases have a little different header from tables thus making it impossible to copy them online through SQL or "copy to". The code below accomplishes this opening the DBC readonly and creating a copy of it using lowlevel IO.
Summary
Databases have a little different header from tables thus making it impossible to copy them online through SQL or "copy to". The code below accomplishes this opening the DBC readonly and creating a copy of it using lowlevel IO.
Description
******
* Please note that params are without extension, 
* no control for that
******
procedure DbBackupOnline
lparameters cDbName, cNewName
r1 = fopen(cDbName+".dbc")    && Just readonly access
r2 = fopen(cDbName+".dct")
r3 = fopen(cDbName+".dcx")
w1 = fcreate(cNewName+".dbc")
w2 = fcreate(cNewName+".dct")
w3 = fcreate(cNewName+".dcx")
=fcopy(r1,w1)
=fcopy(r2,w2)
=fcopy(r3,w3)

function fcopy
lparameters nReadHandle, nWriteHandle
do while !feof(nReadHandle)
 =fwrite(nWriteHandle,fread(nReadHandle,512))
enddo
=fclose(nReadHandle)
=fclose(nWriteHandle)
Cetin Basoz, Engineerica Inc.
Çetin is Engineerica's lead developer and also administering "Institute of Marine Sciences and Technology-Izmir" computer division. He specializes in using Visual FoxPro, .NET and SQL server. He is using Foxbase, Foxpro and Visual FoxPro since 80's, .NET since 2004. He has been a Microsoft MVP 1999-2010. His expertise has been used in prototyping, development, training and testing. Now he continues his carrier on VFP and C#.Net doing mostly Silverlight RIA applications. Though Çetin is well known for his programming skills, very few people know that he is also a licensed Medical Doctor. After practicing medicine for about ten years Çetin switched careers and went to his true passion - software programming.
More articles from this author
Cetin Basoz, September 20, 2000
This will get you the RGB equivalent from a color number. These are 2 little functions doing it different ways. You may try which one fits better your needs. The first one uses the 256 syntax to get the color. The second one is using the BITAND and BITRSHIFT approach.
Cetin Basoz, August 9, 2000
With grids it's a little problematic to show different images or container objects per row. You might have only image filenames stored in a table or you might want to show something like a time table with shape controls where you only store start-end values as numeric. Grid shows the same thing on a...
Cetin Basoz, February 16, 1998
Here is two sample functions one is just for using wordbasic and the second is using wordbasic in mailmerge. Wordbasic PEMs are defined in wrdbasic.hlp located in winword directory. This help file contains the arguments as named arguments which are not suitable for calling via VFP. In files section...
Cetin Basoz, April 26, 2001
Well it started when I found it hard to check rtf files for MSDN subscription index. In last few shipments there were also an MDB in 'UN-SUPPED' directory but my Access is too perfect to use an MDB so I decided to get Access data to VFP tables.
Cetin Basoz, June 1, 2001
Introduction Any data that could be represented in an hierarchical way is a candidate for a treeview listing. This article will show you how to use the MS Active X treeview control in your own applications in a simple way, populate it fast and apply drag&drop to it. Note that this control is ...