03-12-2001, 09:27 PM
i have a problem with inserting new data into database, i am using the recordset AddNew and Update properties...
the error i am reciving is that "null values cannot be inserted" eventhough there is no null value error no is 2147467259 by microsoft cursor engine
if someone can help with a code code snippet it would be very helpful...
03-13-2001, 07:33 AM
Are you inserting values into all your columns? If you aren't and your column(s) are set up such that they do not allow nulls then you would recieve that error.
03-19-2001, 10:22 AM
I am having the same problem but a little different. I am inserting data into an Access 97 database where I DO allow null in the field. However, when I run the insert statement, it demands values for all my fields or I get an error message. In addition, if I try to pull data from a record where one of the values is null I get an error message. Is there a way around this?
Just thought I would try to tag along:-)
03-19-2001, 05:32 PM
I recently had problems with nulls eventhough I set my database to allow nulls(zero lengths). Here is a sample of what I ended up using:
'''For each text box I was loading'''''
If IsNull(mRstCurrent("Name").Value) Then
txtName.Text = ""
txtName = mRstCurrent("Name")
'''For each field in the db I was loading''''
If Trim(txtName.Text) = "" Then
mRstCurrent("Name") = " "
mRstCurrent("Name") = txtName
Hope this is what you were looking for,
03-21-2001, 10:25 PM
Getting values from a potentially null field is not that complicated. It's much easier if you just do this:
sLastName = "" & rsPeople("LastName")
where sLastName is a string and rsPeople is an ADO recordset. This will prevent the problem.