Renaming a table ... ERROR ?!
Hi.
I found this script that I want to use to change a table's name getting its new name from a simple form.
But I got an error. Anyone can help ?!
---------- HERE'S THE SCRIPT :
<%
dim strNome
strTitolo = request.form("Nome")
Set objConn = Server.CreateObject("ADODB.Connection")
strConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("exhibitions.mdb")
objConn.Open strConn
%>
<% '-------------------------------------------------- %>
<%
oldtbl = "main"
newtbl = strNome
Set adox = createObject("ADOX.Catalog")
adox.ActiveConnection = objConn
adox.Tables(oldtbl).Name = newtbl
adox.Tables.Refresh
Set adox = nothing
%>
<% '-------------------------------------------------- %>
<%
objConn.Close
Set objConn = Nothing
%>
------- NOW THE ERROR :
ADOX.Table error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
|