shaju
03-12-2001, 09:27 PM
please help,
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...
thanks,
Shaju
klabranche
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.
http://www.extreme-vb.net/images/icons/smile.gif
evaleah
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:-)
Eva
kingesk
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 = ""
Else
txtName = mRstCurrent("Name")
End If
'''For each field in the db I was loading''''
If Trim(txtName.Text) = "" Then
mRstCurrent("Name") = " "
Else
mRstCurrent("Name") = txtName
End If
Hope this is what you were looking for,
Eric
irenesmith
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.