Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong INSERT stm?

Status
Not open for further replies.

cyexpert

Programmer
Jun 16, 2002
40
CY
i have the following code and i m trying to insert it into an access DB
where is my mistake in the into stm?

// get parameters from a web form
string UName = Request.Params["Name"];
string Surname = Request.Params["Surname"];
string UserName = Request.Params["UserName"];
string Password = Request.Params["Password"];
string Email = Request.Params["Email"];

string insertString = "INSERT INTO Users (Name, Surname, UserName,
Password, Email) VALUES ("UName","Surname","UserName","Password","Email")";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" + Server.MapPath("magazine.mdb");
Thanks,
 
Marty i tryed single quotes too and the same error appears
 
Cyexpert,
I shot from the hip. I do not use access. I would try [varname].
That may do.
Marty
 
Marty i solve it. Access seem not to like that Password field

Thank you for any help
 
Or try using the OleDbCommand instead, it's a secured way of passing SQL statements into a connection (ei. avoid SQL statement injection).
[peace]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top