Re: Set a field to NULL

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Nevermind, the problem was that I was testing for IsNull() in my VB code
when I should have been testing (value <> ""), then sending (SET value =
null) in my SQL.

"Ryan Langton" <langton@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23h0eJ9igFHA.3936@xxxxxxxxxxxxxxxxxxxxxxx
> How do I set a field = NULL in an SQL statement? This field is an
> optional Foreign Key (allows Nulls), but when I try to "SET UserID = NULL"
> I get an error, invalid use of NULL. When I try "SET UserID = ''( -
> single quotes with no characters - ) I get a foreign key constraint error
> (because no value of 'blank' exists in the other table).
>
> Thanks,
> Ryan
>


.



Relevant Pages

  • Re: Using Like operator in VBA
    ... a left bracket [inside the bracket pair to test whether the string ... text string in a SQL statement that you would want to test for? ... If YourVariable contains any of the wildcard characters that are used ...
    (microsoft.public.access.modulesdaovba)
  • Re: Viewing the contents of two tables using ASP and MS Access
    ... Number of fields in a recordset 255 ... Number of characters in a cell in the query design grid 1,024 ... Number of characters in an SQL statement approximately 64,000 ...
    (microsoft.public.inetserver.asp.db)
  • Re: SQL and RPG
    ... the SQL statement is being called ... I don't need the semicolon token, ... ITMI in this example is 6 characters and ITP# is 18 ... If your fields are defined as character you have to put single quotes ...
    (comp.sys.ibm.as400.misc)
  • Re: Logn line
    ... characters for a compact index. ... It still may be your SQL statement length. ... It gave the error message: ... The maximum length for a command line has been exceeded. ...
    (microsoft.public.fox.helpwanted)
  • Re: No more space on line of code?
    ... Sorry Kevin, I guess I was a bit cryptic. ... >> Access MVP ... >>> point where it will no longer accept any more characters. ... >>> as best I know the SQL statement has to be all on one line. ...
    (microsoft.public.access.modulesdaovba)