
October 30th, 2009, 01:05 PM
|
|
Contributing User
|
|
Join Date: Oct 2008
Posts: 38
Time spent in forums: 10 h 32 m 20 sec
Reputation Power: 2
|
|
|
Error when running SQL on ASP Page
Code:
"INSERT INTO an_test1 (First_Name, Surname, DOB, Address1, Address2, Address3, Town, County, PostCode, Telephone, Email, [Password]) VALUES ('"&fname&"','"&sname&"','"&dob&"','"&add1&"','"&add2&"','"&add3&"','"&twn&"','"&cnt&"','"&pc&"','"&tel&"','"&ema&"','"&pas&"') SELECT '"&username&"' = [user] FROM an_test1 INSERT INTO an_test ([Username], [Password]) VALUES ('"&username&"','"&pas&"')"
I get the error
Cannot use empty object or column names. Use a single space if necessary.
The SQL works for the first insert, however when i add the code to select username as user and insert into an_test I get this error.
The sql works when called from a stored procedure but not when the sql is embedded in the asp.
Last edited by apachehelp : October 30th, 2009 at 01:07 PM.
|