RENAME CONNECTION Command Example

The following example assumes an ODBC data source called MyFoxSQLNT is available, and the user ID for the data source is "sa." The testdata database is opened, and a connection named Myconn1 is created. DISPLAY CONNECTIONS is used to display the named connections in the database.

RENAME CONNECTION is then used to change the newly created connection name to Myconn2. DISPLAY CONNECTIONS is used again to display the connection with its new name. The newly renamed connection is then removed from the database with DELETE CONNECTION.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
CREATE CONNECTION Myconn1 DATASOURCE "MyFoxSQLNT" USERID "sa"

CLEAR
DISPLAY CONNECTIONS  && Displays named connections in the database
RENAME CONNECTION Myconn1 TO Myconn2
DISPLAY CONNECTIONS  && Displays connection with new name

DELETE CONNECTION Myconn2  && Removes the connection just renamed