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

VBScript error - Unterminated string constant

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
OK kiddies, here's an easy one for you pros -

VBScript compilation error '800a0409'
Unterminated strin constant

I'm using Internet Explorer 5.5
here's the sql stmt.....

Many thanks, John


sql = "INSERT INTO SystemsAccessReqs (UserNameL, UserNameF, UserNameMI, UserPhoneW, UserPhoneH, UserFax,
Dept#, JobTitle, NewWS, ExistingWS, NewUser, ExistingUser, Marcam, JDE, WMS, PR, TA, NT, NTRoam, LNotes,
LNotesGroup, ColorLaser, DialUpAccess, Modem, ModelAS400, ModelNT, SerReqComments,
DateSubmitted) VALUES ('" & strNameLast & "', '" & strNameFirst & "', '" & strNameMI & "', '" & strPhoneW & "',
'" & strPhoneH & "', '" & strPhoneFax & "', '" & intDept & "', '" & strJobTitle & "', '" & blnNewWS & "',
'" & blnExWS & "', '" & blnNewUser & "', '" & blnExUser & "', '" & blnMarcam & "', '" & blnJDE & "',
'" & blnWMS & "', '" & blnPR & "', '" & blnTA & "', '" & blnNT & "', '" & blnNTRoam & "', '" & blnLNotes & "',
'" & blnCLaser & "', '" & blnDialUp & "', '" & blnModem & "', '" & strModelAS400 & "', '" & strModelNT & "',
'" & strLNotesGroup & "', '" & strSRComments & "', '" & datCurDate & "');"
 
Does one of your variables contain a double quote??

I just ran into that problem with mine...

Mike
 

JohnBates,

I believe you have a variable called "intDept" which is desgnated as an integer. However you have strings around it. This would cause a problem and give you an errant message like the one you received.


fengshui_1998
 
Mike - Thanks; I don't THINK I have a double quote anywhere... but after staring at a screen for 20 years, my eyes aren't as good as they used to be :)

fengshui_1998 - You are probably correct. But how should I refer to int and boolean data types ?

Thanks, John


 


JohnBates,

Remove the single quotes before and after the variable.

'" & strPhoneH & "', '" & strPhoneFax & "', '" & intDept & "', '" &

Should be:

'" & strPhoneH & "', '" & strPhoneFax & "'," & intDept & ", '" &



fengshui_1998
 
Thanks fengshui_1998

Your suggestion worked. John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top