Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 19th, 2004, 05:01 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default string problem

dateUntil=cstr(convNull (objHistoryRate("dtRateTo")))
strGrid =strGrid+ " <TD><INPUT type=""text"" size=15 id=txtdateUntil name=txtdateUntil value='"+ dateUntil+ "'></TD>"
function convNull(str)
    if isNull(str) then
        convNull = ""
    else
        convNull = str
    end if
end function
Please help me to explain why we are using cstr the first code. I have not understood the string.


 
Old October 19th, 2004, 05:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

what is the value that comes with objHistoryRate("dtRateTo")? Also I hope that you should use AMPERSAND (&) instead of PLUS (+) there for concatenation.

_________________________
- Vijay G
Strive for Perfection
 
Old October 19th, 2004, 08:05 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the value coming from "dateRate" are date like 09/09/2004 and
for "dateHourlyRate" is 50. I hope this will help you to give the explanation. Thanks

 
Old October 20th, 2004, 08:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Shoakat,

I could see the usage of CSTR required when the "dtRateTo" contains any of the following possible values.

If it contains Date - then the CStr function will return a string that contains a date in the short-date format.
If it contains Null - then a run-time error will occur.
If it contains Empty - then the CStr function will return an empty string ("").

That is the reason too for using a ConvNull function there.

Hope that explains.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Query string problem sathish_reddy ASP.NET 2.0 Basics 0 February 23rd, 2007 08:18 AM
String Problem seran128 ASP.NET 2.0 Basics 1 April 13th, 2006 11:11 AM
String Problem muki XSLT 0 October 12th, 2005 10:19 PM
Problem with the connection string?? budman Access ASP 2 March 29th, 2004 07:12 AM
connection string problem mateenmohd SQL Server 2000 2 September 3rd, 2003 01:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.