Write null to SQL Server from Access with ADO

I'm trying to write Null to a column in a SQL Server table that is set to take nulls.

I'm using ADO to do this in conjunction with stored procedure parameters.

I've tried setting the parameter value to VBNull and DBNull but VBNull loads 1 to the table and DBNull loads 0.

Is there a way for me to load nulls with ADO?

Thanks.
LVL 2
lee_jdAsked:
Who is Participating?
 
plummetConnect With a Mentor Commented:
Hi Lee_JD

If you want to pass a null value simply don't set the parameter value at all - leave it out - or you could also set it to Empty.

Hope that helps!
John
0
 
lee_jdAuthor Commented:
I need to overwrite the value in the database with Null so not setting a value is not an option.  Also setting the value to Nothing doesn't work either.
0
 
plummetCommented:
What are you writing this in? Are you using .net, c#, vb, ASP, vb6, VBA?
0
 
lee_jdAuthor Commented:
It's okay.  I sorted it with

If value 0 then parameter.value = null else parameter.value = type.value
0
 
plummetCommented:
Great, well done

Cheers
John
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.