How do I insert a Null?

My web application runs fine under RB2012r1.1. In r2.0 and newer I’m getting an error because this statement is throwing an “unsupported format error”

duedate = result.Field("duedate").DateValue

It appears that my prepared statement (below) which edits the database is no longer producing a null in the else condition as it did in r1.1. Instead the double quotes produces an empty string value (I guess that makes sense…). So once the code (above) runs it throws an error instead of passing a nil value to the duedate date object.

if duedate <> nil then statement.Bind(6, duedate.SQLDateTime) else statement.Bind(6, "")

Instead of a double quote is there some other value or constant I can insert that will produce a null?

I tried several things including a nil. No joy.

statement.Bind(6, nil)

It take a variant so it seemed reasonable.

This seems to work.

if duedate <> nil then statement.BindType(6, REALSQLPreparedStatement.SQLITE_TEXT) // duedate else statement.BindType(6, REALSQLPreparedStatement.SQLITE_NULL) end if

Still need to test it, but the initial run worked.