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

UNTERMINATED STRING CONSTANT

Status
Not open for further replies.

rry2k

Programmer
Jun 28, 2001
678
US
Hi,
I have an SQL string in my ASP that is giving me an unterminated string constant. I started with just a comma on the end and then a combination of _ and &. I'm assuming that the problem must be something else. I would greatly appreciate help on this. The line of code where the complier tells me the error is:

sqlstr1 ="INSERT INTO Userinfo(sApplicationDate,sSSN,sDriverLic, & _

Thanks..Russ
 
Should be:
Code:
sqlstr1 ="INSERT INTO Userinfo(sApplicationDate,sSSN,sDriverLic," & _

Followed by the rest of the SQL Statement.

Wushutwist
 
Thanks for the try but that didn't work. I cut and pasted your code in. If you have another thought I would appreciate it.

Thanks..Russ
 
Well you have to finsh the rest of the code, in VB & _ just means to are appending to the String & and you are continuing on to the next line _ . So it is looking for you to continue defining sqlstr1 on the next line.

If you are still having trouble understanding then you will have to post more than one line of your code for me to help. Wushutwist
 
Here's the whole enchalata. If I fixed line 4, why wouldn't I then get an error on line 5?

Thanks..Russ

<!-- #include file = &quot;conn.inc&quot; -->
<%
sqlstr1 =&quot;INSERT INTO Userinfo
(sApplicationDate,sSSN,sDriverLic,&quot; & _
sDriverLicSt,sLastName,sFirstName,sMI, & _
sAddresstype1,sAddress11,sAddress12,sAddress13,sCity1,sState1,sZip1,sAddresstype2,sAddress21,sAddress22,sAddress23,sCity2,sState2,sZip2,sPhonetype1,sPhone1,sPhonetype2,sPhone2,sPhonetype3,sPhone3,sEmail,sReferral,sAvailableDate,sPositionAppliedFor,
sCurrentSalary,sRequiredSalary,sEmrgContact1,sEmrgRelationship1,sEmrgAddress1,sEmrgPhone11,sEmrgPhone12,sEmrgPhysician1,sEmrgPhysicianPhone1,sEmrgContact2,sEmrgRelationship2,sEmrgAddress2,sEmrgPhone21,sEmrgPhone22,sEmrgPhysician2,sEmrgPhysicianPhone2s,Company1,sCompanyCity1,sTitle1,sFrom1,sTo1,sBeginSalary1,sEndSalary1,sReason1,sSupervisor1,sSupervisorTitle1,sSupervisorPhone1,sDuties1,sCompany2,sCompanyCity2,sTitle2,sFrom2,sTo2,sBeginSalary2,sEndSalary2,sReason2,sSupervisor2,sSupervisorTitle2,sSupervisorPhone2,sDuties2sCompany3,sCompanyCity3,sTitle3,sFrom3,sTo3,sBeginSalary3,sEndSalary3,sReason3,sSupervisor3,sSupervisorTitle3,sSupervisorPhone3,sDuties3sCompany4,sCompanyCity4,sTitle4,sFrom4,sTo4,sBeginSalary4,sEndSalary4,sReason4,sSupervisor4,sSupervisorTitle4,sSupervisorPhone4,sDuties4,
sCompany5,sCompanyCity5,sTitle5,sFrom5,sTo5,sBeginSalary5,sEndSalary5,sReason5,sSupervisor5,sSupervisorTitle5,sSupervisorPhone5,sDuties5sSchool1,sMajor1,sDegree1,sYear1,sGPA1,sNotes1,sSchool2,sMajor2,sDegree2,sYear2,sGPA2,sNotes2,sSchool3,sMajor3,sDegree3,sYear3,sGPA3,sNotes3,sSchool4,sMajor4,sDegree4,sYear4,sGPA4,sNotes4,sSchool5,sMajor5,sDegree5,sYear5,sGPA5,sNotes5,sRefName1,sRefCompany1,sRefRelationship1,sRefPhone1,sRefYearsKnown1,sRefName2,sRefCompany2,sRefRelationship2,sRefPhone2,sRefYearsKnown2,sRefName3,sRefCompany3,sRefRelationship3,sRefPhone3,sRefYearsKnown3,sRefName4,sRefCompany4,sRefRelationship4,sRefPhone4,sRefYearsKnown4,sRefName5,sRefCompany5,sRefRelationship5,sRefPhone5,sRefYearsKnown5,sMilBranch,sMilRank,sMilDischargeDte,sMilFrom,sMilTosContactEmpYesNo,
sContactEmpReason,sUSCitizenYesNo,sLegalReason,sConvictYesNo,sConvictDetail,sPersonal)
Values('&quot;+Request(&quot;fApplicationDate&quot;)+&quot;','&quot;+Request(&quot;fDriverLic&quot;)+&quot;','&quot;+Request(&quot;fDriverLicSt&quot;)+&quot;','&quot;+Request(&quot;fLastName&quot;)+&quot;','&quot;+Request(&quot;fFirstName&quot;)+&quot;','&quot;+Request(&quot;fMI&quot;)+&quot;','&quot;+Request(&quot;fAddresstype1&quot;)+&quot;','&quot;+Request(&quot;fAddress11&quot;)+&quot;','&quot;+Request(&quot;fAddress12&quot;)+&quot;','&quot;+Request(&quot;fAddress13&quot;)+&quot;','&quot;+Request(&quot;fCity1&quot;)+&quot;','&quot;+Request(&quot;fState1&quot;)+&quot;','&quot;+Request(&quot;fZip1&quot;)+&quot;','&quot;+Request(&quot;fAddresstype2&quot;)+&quot;','&quot;+Request(&quot;fAddress21&quot;)+&quot;','&quot;+Request(&quot;fAddress22&quot;)+&quot;','&quot;+Request(&quot;fAddress23&quot;)+&quot;','&quot;+Request(&quot;fCity2&quot;)+&quot;','&quot;+Request(&quot;fState2&quot;)+&quot;','&quot;+Request(&quot;fZip2&quot;)+&quot;','&quot;+Request(&quot;fPhonetype1&quot;)+&quot;','&quot;+Request(&quot;fPhone1&quot;)+&quot;','&quot;+Request(&quot;fPhonetype2&quot;)+&quot;','&quot;+Request(&quot;fPhone2&quot;)+&quot;','&quot;+Request(&quot;fPhonetype3&quot;)+&quot;','&quot;+Request(&quot;fPhone3&quot;)+&quot;','&quot;+Request(&quot;fEmail&quot;)+&quot;','&quot;+Request(&quot;fReferral&quot;)+&quot;','&quot;+Request(&quot;fAvailableDate&quot;)+&quot;','&quot;+Request(&quot;fPositionAppliedFor&quot;)+&quot;','&quot;+Request(&quot;fCurrentSalary&quot;)+&quot;','&quot;+Request(&quot;fRequiredSalary&quot;)+&quot;','&quot;+Request(&quot;fCompany1&quot;)+&quot;','&quot;+Request(&quot;fCompanyCity1&quot;)+&quot;','&quot;+Request(&quot;fTitle1&quot;)+&quot;','&quot;+Request(&quot;fFrom1&quot;)+&quot;','&quot;+Request(&quot;fTo1&quot;)+&quot;','&quot;+Request(&quot;fBeginSalary1&quot;)+&quot;','&quot;+Request(&quot;fEndSalary1&quot;)+&quot;','&quot;+Request(&quot;fReason1&quot;)+&quot;','&quot;+Request(&quot;fSupervisor1&quot;)+&quot;','&quot;+Request(&quot;fSupervisorTitle1&quot;)+&quot;','&quot;+Request(&quot;fSupervisorPhone1&quot;)+&quot;','&quot;+Request(&quot;fDuties1&quot;)+&quot;','&quot;+Request(&quot;fCompany2&quot;)+&quot;','&quot;+Request(&quot;fCompanyCity2&quot;)+&quot;','&quot;+Request(&quot;fTitle2&quot;)+&quot;','&quot;+Request(&quot;fFrom2&quot;)+&quot;','&quot;+Request(&quot;fTo2&quot;)+&quot;','&quot;+Request(&quot;fBeginSalary2&quot;)+&quot;','&quot;+Request(&quot;fEndSalary2&quot;)+&quot;','&quot;+Request(&quot;fReason2&quot;)+&quot;','&quot;+Request(&quot;fSupervisor2&quot;)+&quot;','&quot;+Request(&quot;fSupervisorTitle2&quot;)+&quot;','&quot;+Request(&quot;fSupervisorPhone2&quot;)+&quot;','&quot;+Request(&quot;fDuties2&quot;)+&quot;','&quot;+Request(&quot;fCompany3&quot;)+&quot;','&quot;+Request(&quot;fCompanyCity3&quot;)+&quot;','&quot;+Request(&quot;fTitle3&quot;)+&quot;','&quot;+Request(&quot;fFrom3&quot;)+&quot;','&quot;+Request(&quot;fTo3&quot;)+&quot;','&quot;+Request(&quot;fBeginSalary3&quot;)+&quot;','&quot;+Request(&quot;fEndSalary3&quot;)+&quot;','&quot;+Request(&quot;fReason3&quot;)+&quot;','&quot;+Request(&quot;fSupervisor3&quot;)+&quot;','&quot;+Request(&quot;fSupervisorTitle3&quot;)+&quot;','&quot;+Request(&quot;fSupervisorPhone3&quot;)+&quot;','&quot;+Request(&quot;fDuties3&quot;)+&quot;','&quot;+Request(&quot;fCompany4&quot;)+&quot;','&quot;+Request(&quot;fCompanyCity4&quot;)+&quot;','&quot;+Request(&quot;fTitle4&quot;)+&quot;','&quot;+Request(&quot;fFrom4&quot;)+&quot;','&quot;+Request(&quot;fTo4&quot;)+&quot;','&quot;+Request(&quot;fBeginSalary4&quot;)+&quot;','&quot;+Request(&quot;fEndSalary4&quot;)+&quot;','&quot;+Request(&quot;fReason4&quot;)+&quot;','&quot;+Request(&quot;fSupervisor4&quot;)+&quot;','&quot;+Request(&quot;fSupervisorTitle4&quot;)+&quot;','&quot;+Request(&quot;fSupervisorPhone4&quot;)+&quot;','&quot;+Request(&quot;fDuties4&quot;)+&quot;','&quot;+Request(&quot;fCompany5&quot;)+&quot;','&quot;+Request(&quot;fCompanyCity5&quot;)+&quot;','&quot;+Request(&quot;fTitle5&quot;)+&quot;','&quot;+Request(&quot;fFrom5&quot;)+&quot;','&quot;+Request(&quot;fTo5&quot;)+&quot;','&quot;+Request(&quot;fBeginSalary5&quot;)+&quot;','&quot;+Request(&quot;fEndSalary5&quot;)+&quot;','&quot;+Request(&quot;fReason5&quot;)+&quot;','&quot;+Reqest(&quot;fSupervisor5&quot;)+&quot;','&quot;+Request(&quot;fSupervisorTitle5&quot;)+&quot;','&quot;+Request(&quot;fSupervisorPhone5&quot;)+&quot;','&quot;+Request(&quot;fDuties5&quot;)+&quot;','&quot;+Request(&quot;fSchool1&quot;)+&quot;','&quot;+Request(&quot;fMajor1&quot;)+&quot;','&quot;+Request(&quot;fDegree1&quot;)+&quot;','&quot;+Request(&quot;fYear1&quot;)+&quot;','&quot;+Request(&quot;fGPA1&quot;)+&quot;','&quot;+Request(&quot;fNotes1&quot;)+&quot;','&quot;+Request(&quot;fSchool2&quot;)+&quot;','&quot;+Request(&quot;fMajor2&quot;)+&quot;','&quot;+Request(&quot;fDegree2&quot;)+&quot;','&quot;+Request(&quot;fYear2&quot;)+&quot;','&quot;+Request(&quot;fGPA2&quot;)+&quot;','&quot;+Request(&quot;fNotes2&quot;)+&quot;','&quot;+Request(&quot;fSchool3&quot;)+&quot;','&quot;+Request(&quot;fMajor3&quot;)+&quot;','&quot;+Request(&quot;fDegree3&quot;)+&quot;','&quot;+Request(&quot;fYear3&quot;)+&quot;','&quot;+Request(&quot;fGPA3&quot;)+&quot;','&quot;+Request(&quot;fNotes3&quot;)+&quot;','&quot;+Request(&quot;fSchool4&quot;)+&quot;','&quot;+Request(&quot;fMajor4&quot;)+&quot;','&quot;+Request(&quot;fDegree4&quot;)+&quot;','&quot;+Request(&quot;fYear4&quot;)+&quot;','&quot;+Request(&quot;fGPA4&quot;)+&quot;','&quot;+Request(&quot;fNotes4&quot;)+&quot;','&quot;+Request(&quot;fSchool5&quot;)+&quot;','&quot;+Request(&quot;fMajor5&quot;)+&quot;','&quot;+Request(&quot;fDegree5&quot;)+&quot;','&quot;+Request(&quot;fYear5&quot;)+&quot;','&quot;+Request(&quot;fGPA5&quot;)+&quot;','&quot;+Request(&quot;fNotes5&quot;)+&quot;','&quot;+Request(&quot;fEmrgContact1&quot;)+&quot;','&quot;+Request(&quot;fEmrgRelationship1&quot;)+&quot;','&quot;+Request(&quot;fEmrgAddress1&quot;)+&quot;','&quot;+Request(&quot;fEmrgPhone11&quot;)+&quot;','&quot;+Request(&quot;fEmrgPhone12&quot;)+&quot;','&quot;+Request(&quot;fEmrgPhysician1&quot;)+&quot;','&quot;+Request(&quot;fEmrgPhysicianPhone1&quot;)+&quot;','&quot;+Request(&quot;fEmrgContact2&quot;)+&quot;','&quot;+Request(&quot;fEmrgRelationship2&quot;)+&quot;','&quot;+Request(&quot;fEmrgAddress2&quot;)+&quot;','&quot;+Request(&quot;fEmrgPhone21&quot;)+&quot;','&quot;+Request(&quot;fEmrgPhone22&quot;)+&quot;','&quot;+Request(&quot;fEmrgPhysician2&quot;)+&quot;','&quot;+Request(&quot;fEmrgPhysicianPhone2&quot;)+&quot;','&quot;+Request(&quot;fRefName1&quot;)+&quot;','&quot;+Request(&quot;fRefCompany1&quot;)+&quot;','&quot;+Request(&quot;fRefRelationship1&quot;)+&quot;','&quot;+Request(&quot;fRefPhone1&quot;)+&quot;','&quot;+Request(&quot;fRefYearsKnown1&quot;)+&quot;','&quot;+Request(&quot;fRefName2&quot;)+&quot;','&quot;+Request(&quot;fRefCompany2&quot;)+&quot;','&quot;+Request(&quot;fRefRelationship2&quot;)+&quot;','&quot;+Request(&quot;fRefPhone2&quot;)+&quot;','&quot;+Request(&quot;fRefYearsKnown2&quot;)+&quot;','&quot;+Request(&quot;fRefName3&quot;)+&quot;','&quot;+Request(&quot;fRefCompany3&quot;)+&quot;','&quot;+Request(&quot;fRefRelationship3&quot;)+&quot;','&quot;+Request(&quot;fRefPhone3&quot;)+&quot;','&quot;+Request(&quot;fRefYearsKnown3&quot;)+&quot;','&quot;+Request(&quot;fRefName4&quot;)+&quot;','&quot;+Request(&quot;fRefCompany4&quot;)+&quot;','&quot;+Request(&quot;fRefRelationship4&quot;)+&quot;','&quot;+Request(&quot;fRefPhone4&quot;)+&quot;','&quot;+Request(&quot;fRefYearsKnown4&quot;)+&quot;','&quot;+Request(&quot;fRefName5&quot;)+&quot;','&quot;+Request(&quot;fRefCompany5&quot;)+&quot;','&quot;+Request(&quot;fRefRelationship5&quot;)+&quot;','&quot;+Request(&quot;fRefPhone5&quot;)+&quot;','&quot;+Request(&quot;fRefYearsKnown5&quot;)+&quot;','&quot;+Request(&quot;fMilBranch&quot;)+&quot;','&quot;+Request(&quot;fMilRank&quot;)+&quot;','&quot;+Request(&quot;fMilDischargeDte&quot;)+&quot;','&quot;+Request(&quot;fMilFrom&quot;)+&quot;','&quot;+Request(&quot;fMilTo&quot;)+&quot;','&quot;+Request(&quot;fContactEmpYesNo&quot;)+&quot;','&quot;+Request(&quot;fContactEmpReason&quot;)+&quot;','&quot;+Request(&quot;fUSCitizenYesNo&quot;)+&quot;','&quot;+Request(&quot;fLegalReason&quot;)+&quot;','&quot;+Request(&quot;fConvictYesNo&quot;)+&quot;','&quot;+Request(&quot;fConvictDetail&quot;)+&quot;','&quot;+
Request(&quot;fPersonal&quot;)+&quot;')&quot;

set rs=cn.Execute(sqlstr1)%>
<HTML>
<HEAD>
<title>emp app </title>
</HEAD>
<BODY>
<center>
<H1><font color=&quot;red&quot;> WELCOME TO TEST INC.</font> </H1>
<P><h2><font color=&quot;blue&quot; face=&quot;verdana,arial&quot;>Your Information is Successfully entered into our database. Thanks for your time. &nbsp;</font></P>
</center>
</BODY>
</HTML>
 
You never started you quotes again. I will do part of it:
sqlstr1 =&quot;INSERT INTO Userinfo(sApplicationDate,sSSN,sDriverLic,&quot; & _
&quot;sDriverLicSt,sLastName,sFirstName,sMI,&quot; & _

Make sense? You are appending a Strings so you need you double quotes. Wushutwist
 
That did the trick. Sorry to be such a pain and thanks for hanging in there.

Russ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top