this is great thanks alot. I decided to use ADOX before I saw this, the script underneath. Just one more question, do you know how to rename a table through ADOX ?
Dim conn Set conn = Server.CreateObject(\"ADODB.Connection\")
conn.Open dbString
Dim tbl Dim cat
Set tbl = Server.CreateObject (\"ADOX.Table\") Set cat = Server.CreateObject (\"ADOX.Catalog\") cat.ActiveConnection = conn
With tbl .Name = request.form(\"table\") Set .ParentCatalog = cat
As far as I have discovered you can do it using adox, but you have to copy the table with contest to a new table and delete the old. That should could do it.
As far as I have discovered you can do it using adox, but you have to copy the table with contest to a new table and delete the old. That should could do it.
But it would be nice to be able to RENAME a table. Having to first create a table and then copy the data to it could take some time if ther is lots of data in the table.
Det er faktisk ganske nemt at omdøbe en tabel vha. adox. Flg kode kan bruges til det!
Private Sub Command1_Click() Dim tabl As ADOX.Table Set tabl = New ADOX.Table Dim conn As ADODB.Connection Set conn = New ADODB.Connection conn.Provider = "MICROSOFT.JET.OLEDB.4.0" conn.ConnectionString = "D:\valgsprog.mdb" Dim Cat As ADOX.Catalog Set Cat = New ADOX.Catalog conn.Open Cat.ActiveConnection = conn
Cat.Tables.Item("tmp").Name = "Hula Hopsa"
conn.Close
Set conn = Nothing End Sub
først bliver tabellen tmp oprettet og herefter omdøbt til "Hula Hopsa".
VH CK
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.