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!

What [WTF] is wrong with this insert statement?!!!

Status
Not open for further replies.

combs

Programmer
Apr 18, 2002
78
US
This is driving me crazy... I can comment out the sql statement and everything is fine (minus the sql statement never occuring), but when I try to run normally I get an error statement.

Here's the statement:
Code:
strSql = "INSERT INTO tblContractors (Contractor, Owner, Address, City, State, Zip, AreaCode1," _
& " PreFix1, PostFix1, AreaCode2, PreFix2, PostFix2, ExcavationBond, ExcavationBondNum," _
& " ExcavationBondExp, UtilityBond, UtilityBondNum, UtilityBondExp, InsuranceExp, AuthorizedSigners) " _
& "VALUES ('" & strContractor & "', '" & strOwner & "', '" & strAddress & "', '" & strCity & "',  '" _
& strState & "', '" & strZip "', '" & strAreaCode1 & "', '" & strPreFix1 & "', '" & strPostFix1 & "', '" _
& strAreaCode2 & "', '" & strPreFix2 & "', '" & strPostFix2 "', " & intExcavationBond & ", '" _
& strExcavationBondNum "', #" & dteExcavationBondExp & "#, " & intUtilityBond & ", '" _
& strUtilityBondNum & "', #" & dteUtilityBondExp & "#, #" & dteInsuranceExp & "#, '" _
& strAuthorizedSigners & "');"

The error screen/message I get is the generic 500 Internal Server Error. If you could tell me what to put in the web.config file to allow descriptive error statements that would probably help as well.

Thanks in advance for your help!
 
You're missing ampersands after strZip, strPostFix2, and strExcavationBondNum.

See faq333-5427 to get replace the generic message with one that will help
 
guitarzan,

Thanks for your help! I can't believe it was the ampersands ... thought I had checked that a thousand times... Anyway, that was it and I probably wouldn't have found it had it not been for this forum and your help.

Thanks again,
Damon
 
It never hurts to do a:

response.write strSQL
response.end

... for testing. :)



Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top