Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AddNew method failing

0 views
Skip to first unread message

Jim Pandaz

unread,
Feb 8, 2001, 6:36:26 AM2/8/01
to
Hi. Hope someone can help. I'm trying to add a new record via a recordset
object using the AddNew method and I get the following error message:

Run-time error '3251'
Method 'AddNew' of object '_Recordset' failed.

Not sure why I get this error message and tried finding answers on technet
and this site but nothing close to the error message above. Below is a
preview of some of my code. Basically, I've tried making things real simple
by creating a table in SQL Server 7.0 (SP3) with 4 fields with no PK etc.
I've put a watch on the arrFields and looks like I've specified the fields
correctly and I've also put a watch on arrValues and looks like they all
have something as well. I'm running ADO 2.6.

Any ideas? Thanks for any replies.
Jim.

===================================
.
.
arrFields(0) = "EmpID"
arrFields(1) = "EmpName"
arrFields(2) = "Email"
arrFields(3) = "Tel"
arrValues(0) = Text1.Text
arrValues(1) = Text2.Text
arrValues(2) = Text3.Text
arrValues(3) = Text4.Text

rsObj.AddNew arrFields, arrValues ' Error occurs here
.
.
.
================================================

Jim Pandaz

unread,
Feb 9, 2001, 6:50:54 AM2/9/01
to
Just thought I'd let you know what the problem was. I forgot to specify a
locktype for the recordset (which in my case would have defaulted to
adLockReadOnly)...Doh!

Anyway, this prob now solved.

Regards,
Jim.

"Jim Pandaz" <jim...@bigpond.com> wrote in message
news:4hvg6.20280$65.1...@newsfeeds.bigpond.com...

0 new messages