深圳升蓝软件
数据库开发 .Net技术  |  ASP技术 PHP技术 JSP技术 应用技术类   
Hiblue Software

access数据库表改名的一段代码


March 25,2004
<%
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
%>
Copyright © 2001-2008 Shenzhen Hiblue Software Team All rights reserved