Click to See Complete Forum and Search --> : Why am I getting this error message - "-2147467259 cannot insert an empty row...."
goddess_spanky
April 16th, 2001, 11:53 AM
I am getting this message when loading a form connected to a FoxPro6 table. The table has data in it, I told it to go to the last recordset and add a new one when the form loads.
I guess this is a cursor engine error?
Below is the full error message I get
"-2147467259. Cannot insert an empty row - must have at least one column value set. MS Cursor Engine"
Any ideas?
Thanks!
forty7
April 16th, 2001, 02:39 PM
I would include some code here (make sure to show the cursortype, cursorlocation, and locktype).
Is it possible that you are doing an update of the new record before you fill in the data?
thanx/good luck,
adam
goddess_spanky
April 16th, 2001, 02:55 PM
I'm pretty sure I'm not trying to make any updates of the new record...
the cursortype, cursorlocation and locktype are not specified in my code - they are set in the form (using the ADODC properties window)
Here what my code looks like -
private Sub Form_Load()
on error GoTo err_FormLoad
'start-up procedures; fills in date, time and supq agent id
frmSupQ.Show
frmSupQ.SetFocus
ado_FxP_SupQ.Recordset.MoveLast
ado_FxP_SupQ.Recordset.AddNew
txtDate.Text = date
txtStart.Text = Format$(time, "hh:mm:ss")
txtEnd.Text = ""
txtAgentID_SupQ.Text = frmLogin.txtAgentID.Text
txtAgentID_Xfer.SetFocus
me.Refresh
Exit Sub
err_FormLoad:
MsgBox Err.Number & Chr(10) & Err.Description & Chr(10) & Err.Source
resume next
End Sub
Thanks for the help!
Iouri
April 16th, 2001, 03:05 PM
Try to add line at the end
ado_FxP_SupQ.Recordset.Update
Iouri Boutchkine
iouri@hotsheet.com
goddess_spanky
April 16th, 2001, 03:17 PM
the problem is i'm not trying to update a record. this is for a form_load statement where I am trying to add a new record so the user doesn't see any previous records when the form first loads. The error I am getting is related to the cursor engine, but I can figure out why? How is telling the form to update the current record going to help?
Thanks,
AD
Iouri
April 16th, 2001, 03:32 PM
Where are you trying to add record. It can be either a database or disconnected recordset. In both cases yoou need this statement
rs.AddNew
....
rs.Update
VB has the same db engine as Access. The statement AddNew creates an emty line at the end of the recordset. You can save this line either moving to the next record or by Update statement. I think that this is causing your problem
Iouri Boutchkine
iouri@hotsheet.com
goddess_spanky
April 16th, 2001, 04:34 PM
Thanks - I'll try that.
:-)
AD
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.