General discussion

Locked

access 2000

By anbusudar ·
how can i rename a table name in access 2000 database from an asp page using sql?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

access 2000

by andrew In reply to access 2000

Here's a way using the ADOX Library:

Dim oCon 'As ADODB.Connection
Dim oCatalog 'As ADOX.Catalog
Dim oTable 'As ADOX.Table

Set oCon = Server.CreateObject("ADODB.Connection")
oCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\File.mdb;"
Set oCatalog = Server.CreateObject("ADOX.Catalog")
Set oCatalog.ActiveConnection = oCon
Set oTable = oCatalog.Tables("OldTable")
oTable.Name = "NewTable"

oCon.Close

Collapse -

access 2000

by anbusudar In reply to access 2000

Poster rated this answer

Collapse -

access 2000

by andrew In reply to access 2000

Trying to do this enirely from SQL is difficult.

A query like:

UPDATE MSysObjects SET MSysObjects.Name = 'TableNew'
WHERE (((MSysObjects.Id)=44));

Runs into permission problems, and modifying the system table can be tricky.

SQL Server provides a system stored procedure for object renaming, but its over 400 lines long.

Collapse -

access 2000

by anbusudar In reply to access 2000

Poster rated this answer

Collapse -

access 2000

by anbusudar In reply to access 2000

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums