关于ACCESS数据库表改名的一段代码
类别: ASP教程
<%
Call RenameTable("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:example.mdb", "test", "changed")
Sub RenameTable (conStr, oldName, newName)
\'Has to be OLE DB connection
\'Create object and connect to DB...
Dim objADOXDatabase
Set objADOXDatabase = Server.CreateObject("ADOX.Catalog")
objADOXDatabase.ActiveConnection = conStr
\'Change the name...
objADOXDatabase.Tables(oldName).Name = newName
\'Clean up...
Set objADOXDatabase = Nothing
End Sub
%>
Call RenameTable("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:example.mdb", "test", "changed")
Sub RenameTable (conStr, oldName, newName)
\'Has to be OLE DB connection
\'Create object and connect to DB...
Dim objADOXDatabase
Set objADOXDatabase = Server.CreateObject("ADOX.Catalog")
objADOXDatabase.ActiveConnection = conStr
\'Change the name...
objADOXDatabase.Tables(oldName).Name = newName
\'Clean up...
Set objADOXDatabase = Nothing
End Sub
%>
- 上一篇: 真正实现两个列表框动态关联
- 下一篇: IIS5.0中EXECUTE的巧用
-= 资 源 教 程 =-
文 章 搜 索