Here is the SQL statement:
SQL = "INSERT INTO MYIMAGES(image_blob, filename, description, filesize, accountnum, rmanum, billol, copiedfilename) VALUES(?, '"
SQL = SQL & File.Filename & "', '"
SQL = SQL & Replace(Upload.Form("DESCR"), "'", "''") & "', '"
SQL = SQL & File.Size & "', '"
SQL = SQL & Replace(Upload.Form("accountnum"), "'", "''") & "', '"
SQL = SQL & Replace(Upload.Form("rmanum"), "'", "''") & "', '"
SQL = SQL & Replace(Upload.Form("billol"), "'", "''") & "', "
SQL = SQL & Replace(Upload.Form("accountnum"), "'", "''") & "-" & Replace(Upload.Form("rmanum"), "'", "''") & ")"
accountnum = 3456345 rmanum = 345234
The value in the database that gets entered is 3111111 what I want it to be is 3456345-345234
The data type of the column is varchar(255) – what am I doing wrong??
If you use sql parameters you can avoid
REPLACEand also any sql injectionsEx:
Change sql statement to
Then do
….
Updated based on OP comment:
For ASP try this