This topic is locked

Leading Zeros

1/15/2004 4:13:37 PM
ASPRunnerPro General questions
T
toniadm author

I have an Access database in which on of the fields is setup to display leading zeros. After publishing the database with ASPRUNNER, the leading zeros no longer display.
For example in Access the field will display as 001. After publishing, only the 1 is displayed. Is there a way to display leading zeros?
Thanks,

toniadm

Sergey Kornilov admin 1/15/2004

Toniadm,
here is how you can do this.
Open ..._list.asp file in any text editor and find portion of code that displays this field:

<%

if IsBinaryField(rsData.Fields("YourFieldName")) then

   Response.Write CreateImageControl(rsData, "YourFieldName")

else

   Response.Write ProcessLargeText(GetData(rsData.Fields("YourFieldName"), ""))

end if

%>


Make changes in bold:

<%

if IsBinaryField(rsData.Fields("YourFieldName")) then

  Response.Write CreateImageControl(rsData, "YourFieldName")

else

  v = ProcessLargeText(GetData(rsData.Fields("YourFieldName"), ""))

  Response.Write String( 3-len(v), "0") & v


end if

%>

T
toniadm author 1/16/2004

Thank you Sergey. That worked the leading zeros do display now. After making the changes I also received a different reaction for how many records should display on the page. I have it set to display 30 records at a time on each page, but now it only displays 1 - 6 at a time. It varies. Did I do something wrong? I appreciate any assistance that you could provide.
Thanks,

Toniadm

Sergey Kornilov admin 1/17/2004

Toniadm,
it sounds like now it generates some error. Try to comment On Error Resume Next line in the beginning of ..._list.asp file and post error message here.

'On Error Resume Next