Web Hosting Talk







View Full Version : ASP parameter pass error


ibda12u
10-21-2004, 04:48 PM
Hello,
I'm passing info (post) from a form to an asp script, but I keep getting the error Unterminated string constant. The error points to the .FirstName=" portion.

This is the asp script. The Form is a simple form, that posts the form names to this page below

<%
FirstName=Request.Form("FirstName")
LastName=Request.Form("LastName")
%>
<!--#include file="class_net.asp"-->
<%
Set objSU=new commNet
with objSU
.FirstName="<%=Response.Write(FirstName)%>"
.LastName="<%=Response.Write(LastName)%>"
.HomeDir="F:\home\test\"
.EnableDiskQuota=1
.DiskQuota=10
.Expire=dateValue("31/12/2005")
.Access1="F:\home\|RWAMLCDP"
response.write .createUser
end with
set objSU=nothing

Can anyone tell me what I'm doing wrong?

itspot
10-22-2004, 06:40 AM
Set objSU=new commNet
with objSU

' why do you use "<%=Response.Write>" ??
.FirstName=FirstName
.LastName=LastName
.HomeDir="F:\home\test\"
.EnableDiskQuota=1
.DiskQuota=10
.Expire=dateValue("31/12/2005")
.Access1="F:\home\|RWAMLCDP"
response.write .createUser
end with
set objSU=nothing

ibda12u
10-22-2004, 07:38 AM
Thanks, I someone from another forum, pointed that out to me late last night, I didn't get to update it here.

Thanks for the reply, and confirmation.

banner
10-22-2004, 03:08 PM
My guess is the unterminated string constant error is due to this line:
.HomeDir="F:\home\test\"

The \ at the end escapes the " (and the h and t) so in reality you are assigning F:<someChar>ome<someChar>est" to .HomeDir where <someChar> is replaced by whatever \h and \t evaluate to. Typically when you want to have \ in a string you need to escape it by using \\, so your line should probably look like:

.HomeDir="F:\\home\\test\\"

I hope that this helps. Let me know if you have any questions.

ibda12u
10-22-2004, 07:56 PM
Oh it's working correctly, it was just the
.FirstName=FirstName
.LastName=LastName

The .HomeDir="F:\home\test\" is working correctly though... I'll look it over again, but It's creating them correctly

banner
10-22-2004, 08:06 PM
Ok. Maybe VB is different than every other language that I've used. I could very well be wrong since I don't spend much time with VB (only used it once about a year ago). The important thign is that you got things fixed.