Link to home
Create AccountLog in
Avatar of max7
max7

asked on

Script Error - Expected End of Statement on .asp page

Greetings,

Full disclosure: I am wingin' it on this .asp page so I am not surprised I have an error and there are probably more.  But for now, the error is on line 10:

Script error detected at line 10.
Source line: Dim first, last, middle initial, primary email, alt email, primary phone, alt phone, address 1, address 2, city, state, zip, data_source, con, sql_insert
Description: Expected end of statement

I am clueless regarding how to remedy this problem; if anyone needs more information let me know I will gladly provide it.

Thanks
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

variables cannot have spaces in it.
Avatar of max7
max7

ASKER

so what would that look like practically?
Avatar of max7

ASKER

Ok, I just read your profile so I will try to figure it out based on what you said.  If I can't, I'll let you know.
Avatar of max7

ASKER

Interestingly enough, I think I solved it based on your advice because now I get an error message for a different line:

Script error detected at line 33.
Source line: first & "', '" & last & "', '" & middle initial & "', '" & primary email & "', '" & alt email & "', '" & primary phone & "', '" & alt phone & "', '" & address 1 & "', '" & address 2 & "', '" & city & "', '" & state & "', '" & zip & "')"
Description: Expected end of statement

Is this the same problem as it was for line 10?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Hi, because you have changed your variable names in the declaration line (the Dim line), you need to update all of those variable references throughout your code.

The best thing to do would be, for each variable name that you changed, do a Find and Replace All throughout your code to update all of the other references.

For example, on the Dim line, if you change this
Dim first, last, middle initial

to this
Dim first, last, middle_initial

just by adding an underscore, then where-ever you referenced it, say like this:
strName = first & " " & middle initial & " " & last

you need to change that "middle initial" by adding the underscore, to:
strName = first & " " & middle_initial & " " & last

Regards,

Rob.
Avatar of max7

ASKER

Many thanks for the help, angelIII!
Avatar of max7

ASKER

RobSampson -- My apologies but I did not see your comment until after I had closed this question.  Undoubtedly, I will be posting more questions in the future so I hope to hear from you again -- sorry about!
It's OK. No problem.  That happens...

I'll keep an eye out....

Regards,

Rob.