Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 14th, 2005, 04:51 AM
SKE SKE is offline
Authorized User
 
Join Date: Mar 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

 
Old May 15th, 2005, 06:38 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Hi,

I think you are not getting the value of new table.
newtbl = strNome

I am not able to see strNome value in the code. The new value for table name(newtbl) is blank.



Om Prakash
 
Old May 16th, 2005, 06:04 AM
SKE SKE is offline
Authorized User
 
Join Date: Mar 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

THAKS SO MUCH !!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming fields in access table using VBA imaley Access VBA 13 August 13th, 2009 02:22 PM
Renaming App_Code jacob .NET Web Services 5 July 4th, 2006 12:20 AM
Renaming filename simone_s Java Basics 2 May 18th, 2006 12:17 PM
Renaming a Column/Field in Access Table james_sellwood ASP.NET 1.0 and 1.1 Professional 3 February 4th, 2005 08:45 AM
Renaming a dB ioates SQL Server 2000 3 July 2nd, 2003 02:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.