Hi
Can anyone tell me how I can get a table name passed in the URL (page.asp?=blah)to work with the INSERT INTO code below? My attempts with
dim strTblename
strTblename = Request.Querystring("Table"
SQL = "INSERT INTO strTblename
just returns the error message "Could not find output table 'strTblename'"
How can I make it see the 'blah' table name I have passed in the URL?
Thanks.
This is my (not working) script:
<%Set Upload = Server.CreateObject("Persits.Upload"
Upload.Save "c:\upload"
Set File = Upload.Files("THEFILE"
If Not File Is Nothing Then
Connect = "Driver={Microsoft Access Driver (*.mdb)};" &_
"DBQ=" & Server.MapPath("config/datasources/aspupload.mdb"
dim strTblename
strTblename = Request.Querystring("Table"
SQL = "INSERT INTO strTblename(image_blob, filename, description, filesize) VALUES(?, '"
SQL = SQL & File.Filename & "', '"
SQL = SQL & Replace(Upload.Form("DESCR"
, "'", "''"
& "', "
SQL = SQL & File.Size & "
"
File.ToDatabase Connect, SQL
Response.Write "File saved."
Else
Response.Write "File not selected."
End If
%>
Can anyone tell me how I can get a table name passed in the URL (page.asp?=blah)to work with the INSERT INTO code below? My attempts with
dim strTblename
strTblename = Request.Querystring("Table"
SQL = "INSERT INTO strTblename
just returns the error message "Could not find output table 'strTblename'"
How can I make it see the 'blah' table name I have passed in the URL?
Thanks.
This is my (not working) script:
<%Set Upload = Server.CreateObject("Persits.Upload"
Upload.Save "c:\upload"
Set File = Upload.Files("THEFILE"
If Not File Is Nothing Then
Connect = "Driver={Microsoft Access Driver (*.mdb)};" &_
"DBQ=" & Server.MapPath("config/datasources/aspupload.mdb"
dim strTblename
strTblename = Request.Querystring("Table"
SQL = "INSERT INTO strTblename(image_blob, filename, description, filesize) VALUES(?, '"
SQL = SQL & File.Filename & "', '"
SQL = SQL & Replace(Upload.Form("DESCR"
SQL = SQL & File.Size & "
File.ToDatabase Connect, SQL
Response.Write "File saved."
Else
Response.Write "File not selected."
End If
%>