Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Amending the database
Message
From
14/04/2003 12:13:49
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00777236
Message ID:
00777266
Views:
14
Hi Robin.

>How do I make structure changes to the tables in a database on an end users file server programmatically?
>
>How do I add a table to the database in my development enviroment & update the users data enviroment without losing any of the records already in there.

Check out Stonefield Database Toolkit (SDT) at www.stonefield.com. It automates both of these tasks, and many others as well, including repairing corrupted table and memo headers and recreating corrupted indexes.

>I do I change the drive letter/path of a dataenviroment (I presume its embedded in there somewhere?

Change the Database property of a Cursor object in the DataEnvironment. For example, you can use code like this in the BeforeOpenTables method of the DE:
for each loObject in This.Objects
  if upper(loObject.BaseClass) = 'CURSOR'
    lcDatabase = loObject.Database

* If this is a free table, adjust the CursorSource property.

    if empty(lcDatabase)
      lcTable = loObject.CursorSource
      loObject.CursorSource = forcepath(lcTable, lcDirectory)

* This cursor is part of a database, so change the database property.

    else
      loObject.Database = forcepath(lcDatabase, lcDirectory)
    endif empty(lcDatabase)
  endif upper(loObject.BaseClass) = 'CURSOR'
next loObject
This code assumes the directory for the data is in lcDirectory.

Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform