Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Great News... I found method to rename Database Now!
Message
From
20/10/1998 02:38:42
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Great News... I found method to rename Database Now!
Miscellaneous
Thread ID:
00148395
Message ID:
00148395
Views:
56
Thanks Jayesh Patel, (jbpatel@hotmail.com) who provide a tools in File section which can rename database!

But I wonder that the tool cannot work if there is a view in database!
Then, I tried to Open mydatab.dbc, Locate for ObjectType = "View",
and edit the Memo field to Replace all database name to new database name.

In first time, it still fail to work, but... when I tried to replace the new database name with same length to old database name, it works!!

That is, if you want to rename database, use Jayesh's rendbc.app and then do:
* Suppose rename database from 'CompanyA' to 'LimitB'
* (Lens from 8 to 6) So, make it 'CompanyA' to Space(2)+'LimitB'

Procedure FixRenDbc
Lparameters OldDataBName, NewDataBName

LenOldDataB = Len(OldDataBName)
LenNewDataB = Len(NewDataBName)

If LenNewDataB > LenOldDataB
  Messagebox("Sorry, please find a newname with Length is equal or less than OldDatabase Name!", 16, "~_~")
Endif

open newdatab.dbc 
locate for ObjectType = "View"
Do While found()
  Replace Property with StrTran(Property, OldDataBName, ;
     Space(LenOldDataB-LenNewDataB)+NewDataBName)
  Continue
enddo
use 
Although this, if any one database name in view property memo is shorter, it will make the whole database cannot be opened!!
There may be a check on VFP when opening database on even total memo length of view is straightly checked!!

Anyway, it is just a reference only, I will also send this message toJayesh Patel for enhancement! ^-^;
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Reply
Map
View

Click here to load this message in the networking platform