Sql and VB


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Sql and VB

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Sql and VB

    [Originally posted by kev]

    Hello to all,

    Here is what my return recordset looks like from
    a store procedure.

    How do you check for empty string when it return
    NULL.˙ Or how do you test for empty string.

    It very confusing.

    DateDue˙ ˙ PO#˙ ˙  ShippedDate
    ===============================
    1/2/2003˙ 123˙ ˙ ˙ ˙ 2/3/2003
    Null˙ ˙ ˙ 345˙ ˙ ˙ ˙ 3/4/2003
    1/3/2003˙ Null˙ ˙ ˙  Null

    Now, in VB I want to check if the string is empty.

    Example

    if len(trim(DateDue)isNull then
    ˙ msgbox "Date Due is empty
    else
    ˙ msgbox "Date Due is not empty
    endif

    Anyone can help

    thanks˙ ˙

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Sql and VB

    [Originally posted by Zip]

    If (IIF(isNULL(DateField,'',DateField)="") then
    msgbox "DateField Required"
    Else
    msgbox "DateField Populated with " & DateField
    End if

    hope this helps

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Sql and VB

    [Originally posted by Chris Carta]

    If I remeber...

    Dim dtFld As String

    dtFld = DateField & ""

    Will remove a trailing null, and produce an empty string ("") if it is null...but I could be mistaken.

    Chris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center