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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT: INSERT Statement errors..... 1

Status
Not open for further replies.

rjn2001

Programmer
Dec 29, 2004
172
GB
Below is the Insert statement:
Code:
strSQL = "insert into tblUsers (UserID, First_Name, Last_Name, Password,  Sec_ques, Sec_Ans, Birth_Year, Address, Post_Code, e_mail, www, Gender, County, Country, Nationality, Required, OtherPermit, DistributionLogistics, ManOps, StratDev, AccountCon, CorpFin, ITDeploy, ITDesign, ITOther, Marketing, HumanResources, Sales, Purchasing, Automotive, ECommerce, Energy, FinServices, ITIndustry, LeisureIndustry, HealthIndustry, ManufacturingEngineering, NotForProfit, Publishing, Retail, TeleComs, TransportationIndustry, UtilityIndustry, Other) values ('hometime', '" & First_Name& "', '" & Last_Name& "', '" & Password& "' , '" & Sec_ques& "', '" & Sec_Ans& "', '" & Birth_Year& "', '" & Address& "', '" & Post_Code& "', '" & e_mail& "', '" & www& "', '" & Gender& "', '" &County & "', '" &Country & "', '" &Nationality & "','" &Required & "','" & OtherPermit& "','" & DistributionLogistics& "','" & ManOps& "','" & StratDev& "','" & AccountCon& "','" & CorpFin& "','" & ITDeploy& "','" & ITDesign& "','" & ITOther& "','" & Marketing& "','" & HumanResources& "','" & Sales& "','" & Purchasing& "','" & Automotive& "','" & ECommerce& "','" & Energy& "','" & FinServices& "','" & ITIndustry& "','" & LeisureIndustry& "','" & HealthIndustry& "','" & ManufacturingEngineering& "','" & NotForProfit& "','" & Publishing& "','" & Retail& "','" & TeleComs& "','" & TransportationIndustry& "','" & UtilityIndustry& "','" & Other& "');"

Below is the response.write(strSQL) and page error
Code:
estrytyuitgwhjygtuhnjkmRequiredinsert into tblUsers (UserID, First_Name, Last_Name, Password, Sec_ques, Sec_Ans, Birth_Year, Address, Post_Code, e_mail, www, Gender, County, Country, Nationality, Required, OtherPermit, DistributionLogistics, ManOps, StratDev, AccountCon, CorpFin, ITDeploy, ITDesign, ITOther, Marketing, HumanResources, Sales, Purchasing, Automotive, ECommerce, Energy, FinServices, ITIndustry, LeisureIndustry, HealthIndustry, ManufacturingEngineering, NotForProfit, Publishing, Retail, TeleComs, TransportationIndustry, UtilityIndustry, Other) values ('hometime', 'tgwhj', 'ygtuhnjkm', 'Nk9100' , 'What is your Pet Name?', 'fred', '1955', 'drtfyghhjk', 'rfugyhjk', '', '[URL unfurl="true"]http://',[/URL] 'Female', '', 'United Kingdom', '','Required','','','ManOps','','','CorpFin','','','','','','','','','','','','','','','','','','Retail','','','','sxrdxctfvgbh'); 
Microsoft JET Database Engine error '80040e14' 

Syntax error in INSERT INTO statement. 

/verify_insert.asp, line 171


Can ANYBODY point out what is wrong?!

I have been through Access SQL thing with it, and it works, but it wont work from the page.

My boss needs this yesterday!!, please help!!!

Richard Noon
 
even wrap the Password as [Password] because they are key words..

-L
 
got this coming up now:

Code:
Syntax error (missing operator) in query expression '' 'helllllooooowor', 'richard', 'noon', 'noon01' , 'What is your Pet Name?', 'fred', '1957', 'rwou4yt2i34uytiwhrg', 'jhkgiuy', '', '[URL unfurl="true"]http://',[/URL] 'Male', '', 'Haiti', '','Required','','','ManOps','','AccountCon','CorpFin','','','','','','','','Automotive','EC'

Richard Noon
 
what is this '' 'helllllooooowor',

are we mising a comma...between these two fields...

-L
 
no, that is the beginning of the 'error code' it has supplied me with
The code for the page
Code:
hellllloooooworrichardnoonRequiredinsert into tblUsers ([UserID], First_Name, Last_Name, [Password], Sec_ques, Sec_Ans, Birth_Year, Address, Post_Code, e_mail, www, Gender, County, Country, Nationality, Required, OtherPermit, DistributionLogistics, ManOps, StratDev, AccountCon, CorpFin, ITDeploy, ITDesign, ITOther, Marketing, HumanResources, Sales, Purchasing, Automotive, ECommerce, Energy, FinServices, ITIndustry, LeisureIndustry, HealthIndustry, ManufacturingEngineering, NotForProfit, Publishing, Retail, TeleComs, TransportationIndustry, UtilityIndustry, Other) values (' 'helllllooooowor', 'richard', 'noon', 'noon01' , 'What is your Pet Name?', 'fred', '1957', 'rwou4yt2i34uytiwhrg', 'jhkgiuy', '', '[URL unfurl="true"]http://',[/URL] 'Male', '', 'Haiti', '','Required','','','ManOps','','AccountCon','CorpFin','','','','','','','','Automotive','ECommerce','Energy','','','','','','','','','','','','xx'); 
Microsoft JET Database Engine error '80040e14' 

Syntax error (missing operator) in query expression '' 'helllllooooowor', 'richard', 'noon', 'noon01' , 'What is your Pet Name?', 'fred', '1957', 'rwou4yt2i34uytiwhrg', 'jhkgiuy', '', '[URL unfurl="true"]http://',[/URL] 'Male', '', 'Haiti', '','Required','','','ManOps','','AccountCon','CorpFin','','','','','','','','Automotive','EC'. 

/verify_insert.asp, line 170



Richard Noon
 
I'm confused... hellllloooooworrichardnoonRequired is not part of the SQL right?

/boggle
 
Wrap the fields with SERVER.HTMLENCODE where ever you have some special characters...

for example..
'What is your Pet Name?'

if that field name is blah then....do

'"&Server.htmlencode("blah")&"'

-L
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top