...

View Full Version : Why doesn't this work



ecnarongi
01-29-2003, 10:56 PM
if I do something like this it creates the table

SQLmkTbl = "CREATE TABLE CompanyInfo (First_Name VARCHAR(20), Last_Name VARCHAR(30), Company VARCHAR(60) )"

this will create a table called "CompanyInfo", but if I write this

SQLmkTbl = "CREATE TABLE '"& sname &"' (First_Name VARCHAR(20), Last_Name VARCHAR(30), Company VARCHAR(60) )"

where sname is an ASP variable I get nothing, no error, no table, no nothing. I've tested the variable with a response.write statement and it worked great but not in the SQL statement. All help is appreciated, thanks.

whammy
01-29-2003, 11:36 PM
Did you execute the SQL Statement? i.e.:

conn.execute(SQLmkTbl)

Usually it's simple stuff like that which is overlooked.

arnyinc
01-30-2003, 01:22 PM
Response.write your SQL statements and make sure they are the exact same. It looks like you have apostrophes around sname in the second statement.



SQLmkTbl = "CREATE TABLE "& sname &" (First_Name VARCHAR(20), Last_Name VARCHAR(30), Company VARCHAR(60) )"

ecnarongi
01-30-2003, 04:18 PM
Thanks, from the suggestions above I got it to work. :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum