Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rename Database
Message
From
04/01/2005 12:24:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00974109
Message ID:
00974126
Views:
32
>I have a large scale application used by over 350 clients. My company has decided to rename (and expand) this existing application (old name: EDWin new name: iePoint). I have successfully changed the project and related files to the new name. The existing DBC is named EDWin.dbc. I want to rename it to iePoint.dbc. I know that I can rename the DBC within the project, then issue VALIDATE DATABASE RECOVER to correct the backlinks for all tables. My question is this: how will I do this same process at over 350 clients? When the new application is installed at the client's site, the install process will run a VFP "fix" program, but I am not sure how to programatically rename EDWin.dbc to iePoint.dbc and fix the backlinks on all tables.
>
>BTW: I do use Stonefield - could this be of some help?
>
>TIA
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