Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null value as parameter from VB 6

Status
Not open for further replies.

NevG

Programmer
Joined
Oct 10, 2000
Messages
162
Location
GB
hi

Im trying to pass a null value depending on the value of text box from VB into a stored procedure to update a table in SQL server. I cannot work out how to pass the vlue NULL into a date field without getting errors. Please help

Thanks

Nev G
 
What errors are you getting, and how does your code look...
Does the field in question allow nulls?
This is not a bug - it's an undocumented feature...
;-)
 
Yeah the fields allows nulls but Im using a stored procedure that updates the table

the line is

devX.cmdUpdateTable ...,..,..,cdate(txtdate.text),..,.., (42 fields in total)

Im checking txtDate to see if its got nothing in it.

I wanna say if its not then give it a null value. The paramter is of type datetime. Doing a manual UPDATE..SET..= null works fine so I know there a way of somehow gettng a NULL into this bloody prameter

Can you help

Thanks

Nev G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top