Error message : Row must have at least one column value set.

Posted on 2005-04-22
Last Modified: 2008-02-01
First off, thanks for clicking

the error message I get is this in

"Empty row cannot be inserted. Row must have at least one column value set."

Have a form with an "classic" Adodc9 control on it. Converted over from vb6.

It linked to a table with a primary key and several Text fields with AllowZeroLength = No

When I click the New button it runs this code fine Adodc9.RecordSet.AddNew.

Upon clicking the New button it clears all the bound Textboxes on the form.

The error is caused by clicking the Save button and running Adodc9.Recordset.Update.

However, when I type something into one of the Textboxes it updates fine.

Adodc9.Recordset.EditMode = adEditAdd before running .Update

This is the info in the Err handler

? err.Description
"Empty row cannot be inserted. Row must have at least one column value set."
? err.Number
? err.Source
"Microsoft Cursor Engine"

Does anybody know of a way around this since we need the user to be able to save all the fields blank if they so wish??

many thanks all,
Question by:StuartK
    LVL 13

    Accepted Solution

    You need atleast one unique id in each row, it can be autogenerated, otherwise if you have 2 completely blank rows how are you or the db controls to tell one from the other.  This row doesn't have to be accessible or even viewable to the user. Once you have this record identifying row you can have everything else blank.

    LVL 13

    Expert Comment

    One thing you could do is not have it try to save the new row to the database until it has some relevant data. So add an if statement that would check the values and not send the save until there is actually some data to save.

    Author Comment


    Thanks very much.

    Have added in a invisible textbox and bound to the primary key.

    Thanks so much


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB.NET 2008.  So far I'm about half way through, and I've learned quite a few tricks that drastically improve the performance of VB.NET apps. Because there are a…
    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now