J
Jack
THE FOLLOWING IS A PART OF CODE FROM A ASP PAGE
<%
sql01 = "SELECT COUNT(*) AS reccount FROM Equipmenttbl "
sql01 = sql01 & "WHERE Equipmenttbl.GrantID = " & GrantID
'Response.Write sql01 & "<br>"
'Response.End
i = 0
sql01 = "SELECT equipmentTbl.* FROM EquipmentTbl "
sql01 = sql01 & "WHERE EquipmentTbl.GrantID = " & GrantID
response.write "SELECT SQL:" & sql01
'response.end
rstemp.open sql01
'set rstemp=conntemp.execute(sql01)
Do until rstemp.eof
i = i + 1
response.write "<TR>" & vbCRLF
strLink = "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='EquipmentID_" & i &
"' VALUE=" & rstemp("EquipmentID") & "></TD>" & vbCRLF
response.write strLink & vbCRLF
if session("locked")<>"Y" then
strLink = "<TD WIDTH=1% ><A TITLE='Click here to delete line'
HREF='ConfirmDeleteEquipmentLine.asp?EquipmentID=" & rstemp("EquipmentID") &
"'>Delete</A></TD>" & vbCRLF
response.write strLink & vbCRLF
else
strLink = "<TD WIDTH=1% ></A></TD>" & vbCRLF
response.write strLink & vbCRLF
end if
strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=10
NAME='serialnum_"& i & "' VALUE='" & rstemp("SerialNumber") & "'></TD>" &
vbCRLF
response.write strLink & vbCRLF
strLink = "<TD WIDTH=40% ALIGN=LEFT><INPUT TYPE='text' SIZE=45
NAME='Desc_"& i & "' VALUE='" & rstemp("Description") & "'></TD>" & vbCRLF
response.write strLink & vbCRLF
strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=28
NAME='Location_" & i & "' VALUE='" & rstemp("Location") & "'></TD>" & vbCRLF
response.write strLink & vbCRLF
response.write rstemp("Location") & "<br>"
strLink = "<TD WIDTH=10% ALIGN=RIGHT><INPUT TYPE='text' SIZE=12
NAME='Cost_" & i & "' VALUE='" & rstemp("Cost") & "' style='text-align:
right;'></TD>" & vbCRLF
response.write strLink & vbCRLF
strLink = "<TD WIDTH=20% ALIGN=CENTER><INPUT TYPE='text' SIZE=1
NAME='Expmonth_" & i & "'VALUE='" & month(rstemp("DateAcquired")) & "'>/
<INPUT TYPE='text' SIZE=1 NAME='ExpDay_" & i & "'VALUE='" &
day(rstemp("DateAcquired")) & "'>/ <INPUT TYPE='text' SIZE=2 NAME='Expyear_"
& i & "'VALUE='" & year(rstemp("DateAcquired")) & "'></TD>" & vbCRLF
'***************
response.write strLink & vbCRLF
response.write "</TR>" & vbCRLF
totalcost=totalcost+rstemp("Cost")
'save the check box value and Financial Officers name. Should be the
same on
'all records as it will get updated each time the UPDATE button is
clicked.
'Check box and name are redundant but this is the way it was originally
set up
'Decided to go with the flow rather than trying to save these values in
the
'GrantTBL so they are not redundant.
ICertify = rstemp("ICertify")
FinancialOfficer = rstemp("FinancialOfficer")
rstemp.movenext
loop
rstemp.close
%>
</TR>
In the above code which is a input screen (as well as display screen) all
the equipment rows of a particular GrantId is captured
from the above recordset and is displayed in a table format by the above
loop. The problem is that for the values
of location for various rows, if there is a single quote in the row, then
only part of the value is captured in the
location column of this generated table.
I have added a response.write rstemp("Location") & "<br>" statement to see
the values that are retrieved
from the backend table corresponding to the locaion field.In the present
scenario the following was the result i.e. here we can see that the single
quotes
are retrieved as is. The results are the following:
Conference Room's Cabinet
Server Rooom
Don's Room
Server Room
However, in the asp generated table for the location column the values are
as follows:
Conference Room
Server Rooom
Don
Server Room
Thus all character including and after the single quote(') is getting
truncated.
I have no idea why this truncation is happening when the rows are being
dynamically formed in the asp table
but retrieves the whole value by issusing a response.write statement. And
what is the resolution for this problem so
that the location field in the generated asp table shows data without any
truncation.
Any help is appreciated.
Thanks in advance.
<%
sql01 = "SELECT COUNT(*) AS reccount FROM Equipmenttbl "
sql01 = sql01 & "WHERE Equipmenttbl.GrantID = " & GrantID
'Response.Write sql01 & "<br>"
'Response.End
i = 0
sql01 = "SELECT equipmentTbl.* FROM EquipmentTbl "
sql01 = sql01 & "WHERE EquipmentTbl.GrantID = " & GrantID
response.write "SELECT SQL:" & sql01
'response.end
rstemp.open sql01
'set rstemp=conntemp.execute(sql01)
Do until rstemp.eof
i = i + 1
response.write "<TR>" & vbCRLF
strLink = "<TD WIDTH=1% ><INPUT TYPE='HIDDEN' NAME='EquipmentID_" & i &
"' VALUE=" & rstemp("EquipmentID") & "></TD>" & vbCRLF
response.write strLink & vbCRLF
if session("locked")<>"Y" then
strLink = "<TD WIDTH=1% ><A TITLE='Click here to delete line'
HREF='ConfirmDeleteEquipmentLine.asp?EquipmentID=" & rstemp("EquipmentID") &
"'>Delete</A></TD>" & vbCRLF
response.write strLink & vbCRLF
else
strLink = "<TD WIDTH=1% ></A></TD>" & vbCRLF
response.write strLink & vbCRLF
end if
strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=10
NAME='serialnum_"& i & "' VALUE='" & rstemp("SerialNumber") & "'></TD>" &
vbCRLF
response.write strLink & vbCRLF
strLink = "<TD WIDTH=40% ALIGN=LEFT><INPUT TYPE='text' SIZE=45
NAME='Desc_"& i & "' VALUE='" & rstemp("Description") & "'></TD>" & vbCRLF
response.write strLink & vbCRLF
strLink = "<TD WIDTH=10% ALIGN=LEFT><INPUT TYPE='text' SIZE=28
NAME='Location_" & i & "' VALUE='" & rstemp("Location") & "'></TD>" & vbCRLF
response.write strLink & vbCRLF
response.write rstemp("Location") & "<br>"
strLink = "<TD WIDTH=10% ALIGN=RIGHT><INPUT TYPE='text' SIZE=12
NAME='Cost_" & i & "' VALUE='" & rstemp("Cost") & "' style='text-align:
right;'></TD>" & vbCRLF
response.write strLink & vbCRLF
strLink = "<TD WIDTH=20% ALIGN=CENTER><INPUT TYPE='text' SIZE=1
NAME='Expmonth_" & i & "'VALUE='" & month(rstemp("DateAcquired")) & "'>/
<INPUT TYPE='text' SIZE=1 NAME='ExpDay_" & i & "'VALUE='" &
day(rstemp("DateAcquired")) & "'>/ <INPUT TYPE='text' SIZE=2 NAME='Expyear_"
& i & "'VALUE='" & year(rstemp("DateAcquired")) & "'></TD>" & vbCRLF
'***************
response.write strLink & vbCRLF
response.write "</TR>" & vbCRLF
totalcost=totalcost+rstemp("Cost")
'save the check box value and Financial Officers name. Should be the
same on
'all records as it will get updated each time the UPDATE button is
clicked.
'Check box and name are redundant but this is the way it was originally
set up
'Decided to go with the flow rather than trying to save these values in
the
'GrantTBL so they are not redundant.
ICertify = rstemp("ICertify")
FinancialOfficer = rstemp("FinancialOfficer")
rstemp.movenext
loop
rstemp.close
%>
</TR>
In the above code which is a input screen (as well as display screen) all
the equipment rows of a particular GrantId is captured
from the above recordset and is displayed in a table format by the above
loop. The problem is that for the values
of location for various rows, if there is a single quote in the row, then
only part of the value is captured in the
location column of this generated table.
I have added a response.write rstemp("Location") & "<br>" statement to see
the values that are retrieved
from the backend table corresponding to the locaion field.In the present
scenario the following was the result i.e. here we can see that the single
quotes
are retrieved as is. The results are the following:
Conference Room's Cabinet
Server Rooom
Don's Room
Server Room
However, in the asp generated table for the location column the values are
as follows:
Conference Room
Server Rooom
Don
Server Room
Thus all character including and after the single quote(') is getting
truncated.
I have no idea why this truncation is happening when the rows are being
dynamically formed in the asp table
but retrieves the whole value by issusing a response.write statement. And
what is the resolution for this problem so
that the location field in the generated asp table shows data without any
truncation.
Any help is appreciated.
Thanks in advance.