Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing name of a DBC
Message
From
12/04/2005 12:13:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/04/2005 12:07:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01003816
Message ID:
01003822
Views:
18
>I need to migrate a VP 7 application to VFP 9. I would like to change the name of the DBC for the project.
>
>1. Is this worth doing?
>2. What are the implications (side affects)?
>3. If I do it what is the beast (hopefully( also easiest way to do it?
RenDBC('testnew','testdata')

Function RenDbc
lparameters OldName, NewName
Open data (oldName)
lnTables=adbobject(arrTables,'TABLE')
For ix=1 to lnTables
  lcTable = arrTables[ix]+'.DBF'
  handle=fopen(lcTable,12)
  =fseek(handle,8,0)
  lnLowByte = asc(fread(handle,1))
  lnHighByte = asc(fread(handle,1))*256
  lnBackLinkstart = lnHighByte + lnLowByte - 263
  =fseek(handle,lnBackLinkstart,0)
  Fwrite(handle,forceext(newName,'dbc')+replicate(chr(0),263),263)
  =fclose(handle)
Endfor
Close data all
Rename (forceext(oldName,'dbc')) to (forceext(newName,'dbc'))
Rename (forceext(oldName,'dcx')) to (forceext(newName,'dcx'))
Rename (forceext(oldName,'dct')) to (forceext(newName,'dct'))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform