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
strCode="innovatel"
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.addnew
rs(1) = strTitolo
rs(2) = strArtista
rs(3) = strIdartista
rs.update
rs.Close
set rs = Nothing
Dim strSQL
strSQL = "CREATE TABLE --->TABLENAME<--- (file text(255), titolo text(255), info text(255), prezzo integer)"
conn.Execute strSQL
conn.Close
set conn = Nothing
%>
|