Concat in asp

G

Guest

I am trying to concatenate four strings. I have them in four variables and I
get errors when I try to use concat. Can you look at this and see what my
problem is?

I am assigning these variables in the DRW area right after the line that is
grabbing each field.
If I assign each one to the variable fullname singly then they show in my
table. I just can't get a correct concat statement.
I get errors like: Object Required - when I have the concat statement as <%
fullname = lname.concat(fname) %>


and

Expected end of statement

/Finance/PayBills.asp, line 125

fullname = lname.concat fname

when the concat statement is: <% fullname = lname.concat fname %>


<% CustNumber = fp_rs("CUST_NO") %>
<% lname = fp_rs("LAST_NAME") %>
<% fname = fp_rs("FIRST_NAME") %>
<% slname = fp_rs("SPOUSE_LAST_NAME") %>
<% sfname = fp_rs("SPOUSE_FIRST_NAME") %>

<% fullname = lname.concat(fname) %>


<TABLE>
<form action="https://epayment.epymtservice.com/epay.jhtml" method="post">
<TR><TH ALIGN=RIGHT>Customer Number(AKA Biller Payor ID):</TH><TD><input
type="text" name="billerPayorId" value= <% =CustNumber %>></TD></TR>
<TR><TH ALIGN=RIGHT>Product Code:</TH><TD><SELECT NAME="productCode"><OPTION
VALUE="SewerPayment">Sewer Payment
</SELECT></TD></TR>
<TR><TH ALIGN=RIGHT>Amount Due:</TH><TD><input type="text" name="amountDue"
value=<% = BalanceToSend%>></TD></TR>
<TR><TH ALIGN=RIGHT>Current Balance Due:</TH><TD><input type="text"
name="CurrentBalanceDue" value=<% = BalanceToSend%>></TD></TR>
<TR><TH ALIGN=RIGHT>Customer Number:</TH><TD><input type="text"
name="CustomerNumber" value=<% =CustNumber %>></TD></TR>
<TR><TH ALIGN=RIGHT>Line Identifier:</TH><TD><input type="text"
name="LineIdentifier" value="UB"></TD></TR>
<TR><TH ALIGN=RIGHT>Name On Account:</TH><TD><input type="text"
name="NameOnAccount" value=<% = fullname %>></TD></TR>
<TR><TH ALIGN=RIGHT>Biller Id:</TH><TD><input readonly type="text"
name="billerId" value="SWR"></TD></TR>
<TR><TH ALIGN=RIGHT>Biller Group ID:</TH><TD><input readonly type="text"
name="billerGroupId" value="MIS"></TD></TR>
<TR><TH ALIGN=RIGHT>Disallow Login?:</TH><TD><input readonly type="text"
name="disallowLogin" value="N"></TD></TR>
<TR><TH ALIGN=RIGHT></TH><TD></TD></TR>
<TR><TH ALIGN=CENTER><input type="reset" value="Reset"></TH><TH
ALIGN=CENTER><input type="submit" value="Make Payment"></TH></TR>
</form>
</TABLE>
 
M

Mark Fitzpatrick

It's been a while since I worked with classic ASP, but I don't think
VBScript has a concat method. JScript does.

You're getting the object required error because the strings aren't objects,
they're variant datatypes. The VBScript compiler is just throwing an error
because you are obviously trying to access some method, but you don't have
an object currently.

To concatenate in VBScript though is much easier than this, simply use the &
to concatenate two strings like so:

fullname = fname & lname

For more information on VBScript concatenation operators visit:
http://msdn.microsoft.com/library/d...html/7eab59dc-15c1-411f-9a5f-813bf6f74bec.asp

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
S

Stefan B Rusynko

Correct
Or to make it more readable
fullname = fname & " " & lname


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| It's been a while since I worked with classic ASP, but I don't think
| VBScript has a concat method. JScript does.
|
| You're getting the object required error because the strings aren't objects,
| they're variant datatypes. The VBScript compiler is just throwing an error
| because you are obviously trying to access some method, but you don't have
| an object currently.
|
| To concatenate in VBScript though is much easier than this, simply use the &
| to concatenate two strings like so:
|
| fullname = fname & lname
|
| For more information on VBScript concatenation operators visit:
| http://msdn.microsoft.com/library/d...html/7eab59dc-15c1-411f-9a5f-813bf6f74bec.asp
|
| Hope this helps,
| Mark Fitzpatrick
| Microsoft MVP - FrontPage
|
| | >I am trying to concatenate four strings. I have them in four variables and
| >I
| > get errors when I try to use concat. Can you look at this and see what my
| > problem is?
| >
| > I am assigning these variables in the DRW area right after the line that
| > is
| > grabbing each field.
| > If I assign each one to the variable fullname singly then they show in my
| > table. I just can't get a correct concat statement.
| > I get errors like: Object Required - when I have the concat statement as
| > <%
| > fullname = lname.concat(fname) %>
| >
| >
| > and
| >
| > Expected end of statement
| >
| > /Finance/PayBills.asp, line 125
| >
| > fullname = lname.concat fname
| >
| > when the concat statement is: <% fullname = lname.concat fname %>
| >
| >
| > <% CustNumber = fp_rs("CUST_NO") %>
| > <% lname = fp_rs("LAST_NAME") %>
| > <% fname = fp_rs("FIRST_NAME") %>
| > <% slname = fp_rs("SPOUSE_LAST_NAME") %>
| > <% sfname = fp_rs("SPOUSE_FIRST_NAME") %>
| >
| > <% fullname = lname.concat(fname) %>
| >
| >
| > <TABLE>
| > <form action="https://epayment.epymtservice.com/epay.jhtml" method="post">
| > <TR><TH ALIGN=RIGHT>Customer Number(AKA Biller Payor ID):</TH><TD><input
| > type="text" name="billerPayorId" value= <% =CustNumber %>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Product Code:</TH><TD><SELECT
| > NAME="productCode"><OPTION
| > VALUE="SewerPayment">Sewer Payment
| > </SELECT></TD></TR>
| > <TR><TH ALIGN=RIGHT>Amount Due:</TH><TD><input type="text"
| > name="amountDue"
| > value=<% = BalanceToSend%>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Current Balance Due:</TH><TD><input type="text"
| > name="CurrentBalanceDue" value=<% = BalanceToSend%>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Customer Number:</TH><TD><input type="text"
| > name="CustomerNumber" value=<% =CustNumber %>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Line Identifier:</TH><TD><input type="text"
| > name="LineIdentifier" value="UB"></TD></TR>
| > <TR><TH ALIGN=RIGHT>Name On Account:</TH><TD><input type="text"
| > name="NameOnAccount" value=<% = fullname %>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Biller Id:</TH><TD><input readonly type="text"
| > name="billerId" value="SWR"></TD></TR>
| > <TR><TH ALIGN=RIGHT>Biller Group ID:</TH><TD><input readonly type="text"
| > name="billerGroupId" value="MIS"></TD></TR>
| > <TR><TH ALIGN=RIGHT>Disallow Login?:</TH><TD><input readonly type="text"
| > name="disallowLogin" value="N"></TD></TR>
| > <TR><TH ALIGN=RIGHT></TH><TD></TD></TR>
| > <TR><TH ALIGN=CENTER><input type="reset" value="Reset"></TH><TH
| > ALIGN=CENTER><input type="submit" value="Make Payment"></TH></TR>
| > </form>
| > </TABLE>
| >
| >
| >
|
|
 
M

Mark Fitzpatrick

Doh! How did I miss that one :) Now I really need to look at my C# code I
wrote yesterday to make sure I didn't do that there as well hehe

Thanks Stefan
Mark


Stefan B Rusynko said:
Correct
Or to make it more readable
fullname = fname & " " & lname


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| It's been a while since I worked with classic ASP, but I don't think
| VBScript has a concat method. JScript does.
|
| You're getting the object required error because the strings aren't
objects,
| they're variant datatypes. The VBScript compiler is just throwing an
error
| because you are obviously trying to access some method, but you don't
have
| an object currently.
|
| To concatenate in VBScript though is much easier than this, simply use
the &
| to concatenate two strings like so:
|
| fullname = fname & lname
|
| For more information on VBScript concatenation operators visit:
|
http://msdn.microsoft.com/library/d...html/7eab59dc-15c1-411f-9a5f-813bf6f74bec.asp
|
| Hope this helps,
| Mark Fitzpatrick
| Microsoft MVP - FrontPage
|
| | >I am trying to concatenate four strings. I have them in four variables
and
| >I
| > get errors when I try to use concat. Can you look at this and see
what my
| > problem is?
| >
| > I am assigning these variables in the DRW area right after the line
that
| > is
| > grabbing each field.
| > If I assign each one to the variable fullname singly then they show in
my
| > table. I just can't get a correct concat statement.
| > I get errors like: Object Required - when I have the concat statement
as
| > <%
| > fullname = lname.concat(fname) %>
| >
| >
| > and
| >
| > Expected end of statement
| >
| > /Finance/PayBills.asp, line 125
| >
| > fullname = lname.concat fname
| >
| > when the concat statement is: <% fullname = lname.concat fname %>
| >
| >
| > <% CustNumber = fp_rs("CUST_NO") %>
| > <% lname = fp_rs("LAST_NAME") %>
| > <% fname = fp_rs("FIRST_NAME") %>
| > <% slname = fp_rs("SPOUSE_LAST_NAME") %>
| > <% sfname = fp_rs("SPOUSE_FIRST_NAME") %>
| >
| > <% fullname = lname.concat(fname) %>
| >
| >
| > <TABLE>
| > <form action="https://epayment.epymtservice.com/epay.jhtml"
method="post">
| > <TR><TH ALIGN=RIGHT>Customer Number(AKA Biller Payor
ID):</TH><TD><input
| > type="text" name="billerPayorId" value= <% =CustNumber %>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Product Code:</TH><TD><SELECT
| > NAME="productCode"><OPTION
| > VALUE="SewerPayment">Sewer Payment
| > </SELECT></TD></TR>
| > <TR><TH ALIGN=RIGHT>Amount Due:</TH><TD><input type="text"
| > name="amountDue"
| > value=<% = BalanceToSend%>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Current Balance Due:</TH><TD><input type="text"
| > name="CurrentBalanceDue" value=<% = BalanceToSend%>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Customer Number:</TH><TD><input type="text"
| > name="CustomerNumber" value=<% =CustNumber %>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Line Identifier:</TH><TD><input type="text"
| > name="LineIdentifier" value="UB"></TD></TR>
| > <TR><TH ALIGN=RIGHT>Name On Account:</TH><TD><input type="text"
| > name="NameOnAccount" value=<% = fullname %>></TD></TR>
| > <TR><TH ALIGN=RIGHT>Biller Id:</TH><TD><input readonly type="text"
| > name="billerId" value="SWR"></TD></TR>
| > <TR><TH ALIGN=RIGHT>Biller Group ID:</TH><TD><input readonly
type="text"
| > name="billerGroupId" value="MIS"></TD></TR>
| > <TR><TH ALIGN=RIGHT>Disallow Login?:</TH><TD><input readonly
type="text"
| > name="disallowLogin" value="N"></TD></TR>
| > <TR><TH ALIGN=RIGHT></TH><TD></TD></TR>
| > <TR><TH ALIGN=CENTER><input type="reset" value="Reset"></TH><TH
| > ALIGN=CENTER><input type="submit" value="Make Payment"></TH></TR>
| > </form>
| > </TABLE>
| >
| >
| >
|
|
 
G

Guest

I am getting stuck on this because of the scope of variables I believe. Here
is what's happening. lname and fname are showing up as brown text in
frontpage, they are declared by <% lname = fp_rs("LAST_NAME") %> directly
after the DBRW line that is bringing LAST_NAME from my database.

If I put those variable names in a vb or java script area, they are black
and no value is associated with them.
 
S

Stefan B Rusynko

Your variables need to be declared inside of the actual DBRW results
(between the 2 yellow rows)

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I am getting stuck on this because of the scope of variables I believe. Here
| is what's happening. lname and fname are showing up as brown text in
| frontpage, they are declared by <% lname = fp_rs("LAST_NAME") %> directly
| after the DBRW line that is bringing LAST_NAME from my database.
|
| If I put those variable names in a vb or java script area, they are black
| and no value is associated with them.
|
| "Mark Fitzpatrick" wrote:
|
| > It's been a while since I worked with classic ASP, but I don't think
| > VBScript has a concat method. JScript does.
| >
| > You're getting the object required error because the strings aren't objects,
| > they're variant datatypes. The VBScript compiler is just throwing an error
| > because you are obviously trying to access some method, but you don't have
| > an object currently.
| >
| > To concatenate in VBScript though is much easier than this, simply use the &
| > to concatenate two strings like so:
| >
| > fullname = fname & lname
| >
| > For more information on VBScript concatenation operators visit:
| > http://msdn.microsoft.com/library/d...html/7eab59dc-15c1-411f-9a5f-813bf6f74bec.asp
| >
| > Hope this helps,
| > Mark Fitzpatrick
| > Microsoft MVP - FrontPage
| >
| > | > >I am trying to concatenate four strings. I have them in four variables and
| > >I
| > > get errors when I try to use concat. Can you look at this and see what my
| > > problem is?
| > >
| > > I am assigning these variables in the DRW area right after the line that
| > > is
| > > grabbing each field.
| > > If I assign each one to the variable fullname singly then they show in my
| > > table. I just can't get a correct concat statement.
| > > I get errors like: Object Required - when I have the concat statement as
| > > <%
| > > fullname = lname.concat(fname) %>
| > >
| > >
| > > and
| > >
| > > Expected end of statement
| > >
| > > /Finance/PayBills.asp, line 125
| > >
| > > fullname = lname.concat fname
| > >
| > > when the concat statement is: <% fullname = lname.concat fname %>
| > >
| > >
| > > <% CustNumber = fp_rs("CUST_NO") %>
| > > <% lname = fp_rs("LAST_NAME") %>
| > > <% fname = fp_rs("FIRST_NAME") %>
| > > <% slname = fp_rs("SPOUSE_LAST_NAME") %>
| > > <% sfname = fp_rs("SPOUSE_FIRST_NAME") %>
| > >
| > > <% fullname = lname.concat(fname) %>
| > >
| > >
| > > <TABLE>
| > > <form action="https://epayment.epymtservice.com/epay.jhtml" method="post">
| > > <TR><TH ALIGN=RIGHT>Customer Number(AKA Biller Payor ID):</TH><TD><input
| > > type="text" name="billerPayorId" value= <% =CustNumber %>></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Product Code:</TH><TD><SELECT
| > > NAME="productCode"><OPTION
| > > VALUE="SewerPayment">Sewer Payment
| > > </SELECT></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Amount Due:</TH><TD><input type="text"
| > > name="amountDue"
| > > value=<% = BalanceToSend%>></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Current Balance Due:</TH><TD><input type="text"
| > > name="CurrentBalanceDue" value=<% = BalanceToSend%>></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Customer Number:</TH><TD><input type="text"
| > > name="CustomerNumber" value=<% =CustNumber %>></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Line Identifier:</TH><TD><input type="text"
| > > name="LineIdentifier" value="UB"></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Name On Account:</TH><TD><input type="text"
| > > name="NameOnAccount" value=<% = fullname %>></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Biller Id:</TH><TD><input readonly type="text"
| > > name="billerId" value="SWR"></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Biller Group ID:</TH><TD><input readonly type="text"
| > > name="billerGroupId" value="MIS"></TD></TR>
| > > <TR><TH ALIGN=RIGHT>Disallow Login?:</TH><TD><input readonly type="text"
| > > name="disallowLogin" value="N"></TD></TR>
| > > <TR><TH ALIGN=RIGHT></TH><TD></TD></TR>
| > > <TR><TH ALIGN=CENTER><input type="reset" value="Reset"></TH><TH
| > > ALIGN=CENTER><input type="submit" value="Make Payment"></TH></TR>
| > > </form>
| > > </TABLE>
| > >
| > >
| > >
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top