These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Error AddNew Operation Failed

bctflex
Registered: Aug 8 2008
Posts: 37
Answered

Hi,

I am using a database connection snipet with the following code. All of the other buttons (First,Last,Update,Cancel) on the form execute properly with the exception of the AddNew button which is suppose to create a new record within a SQL database with an ODBC connection. Here is the error:

Error addNew Operation failed. Empty row set cannot be inserted. Row must have at least one column value set.

----- Form1.InjuryNotice.dbAddNew[1]::click: - (FormCalc, client) ----------------------------------

// Database control button >> add a new record.

// Changing records implies updating the current record with any changes. Enabling this statement would ensure that no changes are committed
// without the user explicitly using the Update button.
//xfa.sourceSet.DataConnection.cancel()

xfa.sourceSet.SupvrRprt.addNew()

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I would suggest placing some data in at least one of the bound fields before applying the addNew(). If there are no bound fields then you'll need to write directly to one of the sourceSet.SupvrRprt components

I would aslo suggest removing any autoInc or ReadOnly fields from the DB.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script