ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 26th, 2003, 04:36 AM
Abd Abd is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: NIG
Posts: 4 Abd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Concatenating Control buttons

Hi All,

I pls want a help in my piece of code, I am actually populating the form with data from an MS SQL Database, but I want to concatenate the firstname with the output been dispalyed in the Text Area. Below is my code;

Thnaks
Abd

<%
category = TRIM( Request.Form( "cat" ) )
username = TRIM( Request.Form( "username" ) )



IF username <> "" THEN
Set Con = Server.CreateObject( "ADODB.Connection" )
Con.Open "PROVIDER=SQLOLEDB;DATA SOURCE=ABD;UID=sa;PWD=abd;DATABASE=abdul"
Set RS= Server.CreateObject( "ADODB.Recordset" )

If category = "Globe" then
RS.Open "select * from globe where phonenum = '" &username& "'", Con

firstname = RS.Fields("firstname")
lastname = RS.Fields("lastname")
middlename = RS.Fields("middlename")
homeadd = RS.Fields("homeadd")
busadd = RS.Fields("busadd")
terrifplan = RS.Fields("terrifplan")
state = RS.Fields("state")
phonenum = RS.Fields("phonenum")
typeofpay = RS.Fields("typeofpay")
assignedto = RS.Fields("assignedto")
nservicereq = RS.Fields("nservicereq")
//Comment = RS.Fields("Comment")



End if
Con.Close
Set RS = Nothing
Set Con = Nothing
END IF
%>


<Html>
<head><title>Return Data</title>

</head>
<body>



<form name="form1" method="post" action="updcsr.asp?cate">

&nbsp; <input type="text" id="globe2" value="Globe2" name="cate" readonly>

<h1 align="center"><font color="blue" size=+2>Customer Demographic Information</font></h1>
<br>
<b>First Name:</b>
&nbsp;<input name="FirstName" type="text" value="<%=Server.HTMLEncode(firstname)%>" readonly>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Last Name:</b>
&nbsp;<input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(lastname)%>" readonly>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Middle Name:</b>
&nbsp;<input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(middlename)%>" readonly>
<p>
<b>Home Address:</b>
&nbsp;<input name="Address" type="text" size="17" value="<%=Server.HTMLEncode(homeadd)%>" readonly>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Business Address:</b>
&nbsp;<input name="PositionCode" type="text" size="15" value="<%=Server.HTMLEncode(busadd)%>" readonly>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Tarrif Plan:</b>
&nbsp;<input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(terrifplan)%>" readonly>
<p>
<b>State:</b>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="Address" type="text" value="<%=Server.HTMLEncode(state)%>" readonly>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue"><b>Phone Number:</b></font>
&nbsp;<input name="PositionCode" type="text" size="18" value="<%=Server.HTMLEncode(phonenum)%>" readonly>
<p>
<b>Mode of Payment:</b>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="Address" type="text" value="<%=Server.HTMLEncode(typeofpay)%>" readonly>

<hr>

<br>

<%
//Populating Text Area with an entire column data from the Database

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=ABD;UID=sa;PWD=abd;DATABASE=abdul"

Set rs=Conn.execute("Select nservicereq from globe")
Commnet = RS.Fields("nservicereq")

response.write "<b>Service Reqst History:</b><br><TEXTAREA NAME='Comment' ROWS=5 COLS=80>"&vbcrlf
while not rs.eof
response.write ""&rs("nservicereq")&""&vbcrlf
rs.movenext
wend
response.write "</TEXTAREA>"&vbcrlf
rs.close
set rs=nothing
Conn.close
set Conn=nothing
%>


<p align="center"><input type="submit" value="New Request">
<p>

</form>

<SCRIPT LANGUAGE="JavaScript">

//To Hide Globacom Textbox
document.getElementById("globacom2").style.display = 'none'
</SCRIPT>

</body>
</html>

Reply With Quote
  #2  
Old March 27th, 2003, 01:22 AM
yassoor's Avatar
yassoor yassoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada - Egypt
Posts: 60 yassoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
I don't see the problem

why not just add

Response.write firstname

after:

while not rs.eof
response.write ""&rs("nservicereq")&""&vbcrlf
rs.movenext
wend

!

My apologies if I miss-understood the question
__________________
I hope this is of any help to anyone.

Yassoor
http://www.WebsitesCreation.ca

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Concatenating Control buttons

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap