rename connection 命令示例

下面的示例假定名为 myfoxsqlnt 的 odbc 数据源可用,并且数据源的用户 id 是“sa”。首先,打开 testdata 数据库,创建名为 myconn1 的连接。然后,使用 display connections 命令显示数据库中这个命名连接。然后再使用 rename connection 命令将新创建的连接名称改为 myconn2之后,再使用 display connections 命令用连接的新名称显示此连接。最后,用 delete connection 从数据库删除该命名连接。

close databases
open database (sys(2004) + 'samples\data\testdata')
create connection myconn1 datasource "myfoxsqlnt" userid "sa"

clear
display connections && 显示数据库中的一个命名连接
rename connection myconn1 to myconn2
display connections && 用新名称再次显示连接

delete connection myconn2 && 删除刚改过名的连接