SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

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 ASP Free Forums Sponsor:
  #1  
Old May 3rd, 2001, 01:48 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
Null record not putting in space ??

<i><b>Originally posted by : Mal (mal@go-planit.com)</b></i><br /><% for i = 0 to howmanyfields<br /> ThisRecord = MyRs(I)<br /> If IsNull(ThisRecord) Then<br /> ThisRecord = " "<br />end if %><br /><br />Can anyone see whats wrong with above code ?? If the field is empty a space is supposed to be inserted....but it isn't working.<br /><br />Cheers<br />

Reply With Quote
  #2  
Old June 25th, 2001, 05:26 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<i><b>Originally posted by : Jerry Scannell (JScannell1@home.com)</b></i><br /><br /><br /><br />------------<br />Mal at 5/3/2001 10:48:40 AM<br /><br /><% for i = 0 to howmanyfields<br /> ThisRecord = MyRs(I)<br /> If IsNull(ThisRecord) Then<br /> ThisRecord = " "<br />end if %><br /><br />Can anyone see whats wrong with above code ?? If the field is empty a space is supposed to be inserted....but it isn't working.<br /><br />Cheers<br /><br />Basically, if ThisRecord doesn't end up as a single space, then ThisRecord wasn't determined to be null by the IsNull() function. <br /><br />There is a quirk that I have been struggling with as far as ASP is concerned with the basic question: "What is a Null, anyway?" <br /><br />Since VB Scripts really don't know what data types are (you have to call IsNull(), or IsNumber(), or IsDate() to find out) I think it has a problem answering the IsNull() question when it doesn't think the data is a String! If you think about it. if VB Scripts assumed something was a number and it came up empty, it wouldn't answer IsNull() = True. I'm convinced that we are all left out there hanging on this.<br /><br />I had to design a workaround that works every time so far.<br /><br />here is a function that works:<br />Function IsBlank ( string )<br /> Dim Local_String<br /> Local_String = Trim ( string )<br /> if len ( Local_String ) = 0 then<br /> IsBlank = True<br /> else<br /> IsBlank = False<br /> end if<br />end Function<br /><br />To use it:<br /><br />if IsBlank ( string ) then<br /> Local_String = " "<br />else<br /> Local_String = Cstr( string )<br />end if<br /><br /><br />Setting it equal to " " makes the variable a string, and Cstr() forces the issue on a previously unknown data type. <br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Null record not putting in space ??


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT