Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
RENAME CONNECTION Command
Collapse the table of content
Expand the table of content

RENAME CONNECTION Command

Renames a named connection in the current database.


RENAME CONNECTION ConnectionName1 TO ConnectionName2

Parameters

ConnectionName1

Specifies the name of the connection to be renamed.

ConnectionName2

Specifies the new name of the connection.

The database containing the named connection must be opened exclusively and must be current before the connection can be renamed. To open a database for exclusive use, include EXCLUSIVE in OPEN DATABASE.

The following example assumes an ODBC data source called MyFoxSQLNT is available. 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 "<userid>" PASSWORD "<password>"

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

Community Additions

ADD
Show:
© 2015 Microsoft