How do i set a variable to NULL???

Results 1 to 2 of 2

Thread: How do i set a variable to NULL???

  1. #1
    Join Date
    Dec 1969

    Default How do i set a variable to NULL???

    Hi! question is how can i set a variable to null...for example:<BR>Dim FE, FS as Date<BR>Try<BR> FE = Parse.Date(X.Text)<BR>Catch e as Exception<BR> FE = NULL &#060;---How can I do this????, &#039;cause if i do it like this it says that i can use the NULL value anymore, insted i have to use the System.DBNULL, but i don´t know whats that, can anyone help me??<BR><BR>thanks !<BR>:)

  2. #2
    Join Date
    Dec 1969

    Default RE: How do i set a variable to NULL???

    Hi!<BR> If you initialize the variable as an object and then set the variable to a new instance of the desired data type, you can do it.<BR>But I don&#039;t think that you can set a variable that was initialized as type date to null. I tried, but I was able to do it this way.<BR>Here is an example of what i tried...<BR><BR> Dim FS, FE As Object<BR> Try<BR> FS = New Date()<BR> FE = New Date()<BR> FE = FS.Parse("9/5/2002")<BR> If Not IsDBNull(FE) Then MsgBox("Not Null Yet")<BR> MsgBox("Now Setting FE to Null")<BR> FE = System.DBNull.Value<BR> If IsDBNull(FE) Then MsgBox("Its Null")<BR> Catch er As Exception<BR> MsgBox(er.Message)<BR> End Try<BR><BR>Hope this helps! :)<BR><BR>Jeff.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts