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 March 15th, 2005, 04:30 PM
SKE SKE is offline
Authorized User
Join Date: Mar 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Naming a new table

Hi !
My script adds few records to a database, then I need the same script to create a new table in the database.
The question is how can I tell the script to name the new table with the name of the first string (in this case strTitolo)?

This is my script :

dim strTitolo
strTitolo = request.form("titolo")

dim strArtista
strArtista = request.form("artista")

dim strIdartista
strIdartista = request.form("idartista")

dim strCode

Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("exhibitions.mdb")
strConn=strConn & ";pwd=" & strCode
Conn.Open strConn

sql = "SELECT * FROM exhibitions"

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn ,3,3

rs(1) = strTitolo
rs(2) = strArtista
rs(3) = strIdartista
set rs = Nothing

Dim strSQL
strSQL = "CREATE TABLE --->TABLENAME<--- (file text(255), titolo text(255), info text(255), prezzo integer)"
conn.Execute strSQL

set conn = Nothing

Old March 18th, 2005, 05:46 AM
Friend of Wrox
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts

You can use the following string to get create table script:

strSQL = "CREATE TABLE " & strTitolo & " (file text(255), titolo text(255), info text(255), prezzo integer)"

Om Prakash
Old March 23rd, 2005, 03:25 PM
SKE SKE is offline
Authorized User
Join Date: Mar 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks a lot man !


Similar Threads
Thread Thread Starter Forum Replies Last Post
Table path using 4 part naming convention snufse SQL Server 2000 1 February 1st, 2008 07:45 PM
Variables in the four naming conventions FJInfante SQL Server 2000 3 May 1st, 2006 01:06 PM
Table output to Excel and auto naming file newbe Access 6 December 13th, 2005 06:54 AM
Naming Exception in Tomcat5.x enjay Apache Tomcat 3 August 12th, 2005 05:55 AM
Naming conventions jara VS.NET 2002/2003 3 June 22nd, 2003 04:21 AM

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