Results 1 to 7 of 7

Thread: Put a <NULL> in a SQL database

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2003
    Location
    Three Rivers, MI
    Posts
    354

    Put a <NULL> in a SQL database

    I am building a front end for a shrink-wrapped accounting program. I have one feild in my app that can sometimes contain a value and sometimes not. The problem that I am having is that the shrink-wrapped program will not accept an empty string in the field of the database.

    There has to be a value or it has to be a <NULL>. Empty strings such as "" cause it to error. Any ideas of how to accomplish this from my form?

    In my AddRecord Function I have this but none of these worked.
    VB Code:
    1. Dim strCityTax As String
    2.  
    3.         If txtCityTax.Text = "" Then
    4.             'strCityTax = vbNullString
    5.             'strCityTax = Convert.DBNull
    6.             'strCityTax = DBNull
    7.             'strCityTax = vbNullString.ToString
    8.         Else
    9.             strCityTax = txtCityTax.Text
    10.         End If
    Last edited by BukHix; Apr 7th, 2004 at 08:51 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width