waqas_hussain
October 24th, 2001, 05:57 AM
I've got this problem, that I can't get around. I'm sending a null value through an SQL "INSERT INTO" statement using ADO, but the database does not accept the value in either date or numeric data type field. Even it's allow null is set to true. I've tested this problem with SQL Server and Microsoft Access. is there any solution for this problem, I need to do it with Insert into statement because I'm using Data Environment. (The field is optional, some
time I have to send values and some time not. So it is necessary to mention the name of field in the query, and obviously I can't make two queries for the one optional parameter because what if I have 2 or more optional parameters???)
This problem is also with command object.
I dont want to use ..
Rs.AddNew
Rs.fields("m_ID") = null
Rs.Update
I've tried everything, and it seems impossible through vb. You may accept it as a challenge.
Remember.. INSERT INTO STATEMENT .. NULL VALUES.
time I have to send values and some time not. So it is necessary to mention the name of field in the query, and obviously I can't make two queries for the one optional parameter because what if I have 2 or more optional parameters???)
This problem is also with command object.
I dont want to use ..
Rs.AddNew
Rs.fields("m_ID") = null
Rs.Update
I've tried everything, and it seems impossible through vb. You may accept it as a challenge.
Remember.. INSERT INTO STATEMENT .. NULL VALUES.