Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A problem with DataGrid bound with Adodc

Status
Not open for further replies.

griffitd

Programmer
Aug 20, 2002
189
0
0
GB
I bound DataGrid with Adodc. DataGrid has enabled AllowUpdate, AllowDelete etc. When an adodc.recordset isn't empty (table has records) everything works fine. However, if that recordset is empty (BOF, EOF = true, table in database has no records) I can't fill row in DataGrid to add new (first) record. In addition it occurs only sometimes and I couldn't catch what's the reason. I've heard that similar problems occurs in RDO, too.

The message i get from dataGrid is: "The current row is unavailable"

Question: How to solve this problem?

Thanks
 
Are you talking about manual entry of the first row (typing in the row with * in the row marker at the left)?

Fiddling with the ADODC's Recordset property to do this programmatically is sort of silly. For that you normally just skip using ADODCs anyway. But I can't think of why an .AddNew wouldn't work.

Tested, works fine here!

Code:
Private Sub mnuDink_Click()
    'Field 0 is an autonumber ID field:
    Adodc.Recordset.AddNew Array(1, 2, 3, 4), Array("x", "y", "z", "w")
End Sub

You must have something else going on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top