Home > ASP Development > ISERT INTO error

ISERT INTO error



I am Getting the following error:



Microsoft OLE DB Provider for SQL Server error '80040e14'



Line 1: Incorrect syntax near 'Request.Form("item_name")'.





My code:



<%



Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Open MM_bobmar_STRING



strSql = "INSERT INTO usr14377.Mike_Customers (TransID, CompanyName, FirstName, LastName, BillingAddress, City, State, PostalCode, Country, EmailAddress, Notes) VALUES('Request.Form(""txn_id"")','Request.Form(""payer_business_name"")','Request.Form(""first_name"")','Request.Form(""last_name"")','Request.Form(""address_street"")','Request.Form(""address_city"")','Request.Form(""address_state"")','Request.Form(""address_zip"")','Request.Form(""address_country"")','Request.Form(""payer_email"")','Request.Form(""item_name"")'"

Conn.Execute(strSql)



Conn.Close

Set Conn = Nothing



%>



Could Someone Please Help me:



Thank You In Advance...

    
Guest


try this one buddy



Id=Trim(Request.Form("txn_id"))

payer_business_name=Trim(Request.Form("payer_business_name"))

first_name=Trim(Request.Form("first_name"))

last_name=Trim(Request.Form("last_name"))

address_street=Trim(Request.Form("address_street"))

address_city=Trim(Request.Form("address_city"))

address_state=Trim(Request.Form("address_state"))

address_zip=Trim(Request.Form("address_zip"))

address_country=Trim(Request.Form("address_country"))

payer_email=Trim(Request.Form("payer_email"))

item_name=Trim(Request.Form("item_name"))



strSql = "INSERT INTO usr14377.Mike_Customers (TransID, CompanyName, FirstName, LastName, BillingAddress,

City, State, PostalCode, Country, EmailAddress, Notes)

VALUES('"& Id &"','"& payer_business_name &"','"& first_name &"','"& last_name &"','"& address_street &"',

'"& address_city &"','"& address_state &"','"& address_zip &"','"& address_country &"','"& payer_email &"','"& item_name &"')"

Conn.Execute(strSql)







thanks,



charles

Was this answer helpful ? Yes No   
Guest


Thank You It worked great

Was this answer helpful ? Yes No   
Guest


no probs glad it worked out for u



charles

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved