CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2001
    Location
    Salt Lake City, UT
    Posts
    135

    Why am I getting this error message - "-2147467259 cannot insert an empty row...."


    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!

    "There are no stupid questions, but there are a lot of inquisitive idiots."

  2. #2
    Join Date
    Apr 2001
    Location
    CA
    Posts
    153

    Re: Why am I getting this error message - "-2147467259 cannot insert an empty row...."

    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
    thanx/good luck

  3. #3
    Join Date
    Apr 2001
    Location
    Salt Lake City, UT
    Posts
    135

    Re: Why am I getting this error message - "-2147467259 cannot insert an empty row...."

    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!

    "There are no stupid questions, but there are a lot of inquisitive idiots."

  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Why am I getting this error message - "-2147467259 cannot insert an empty row...."

    Try to add line at the end

    ado_FxP_SupQ.Recordset.Update

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  5. #5
    Join Date
    Apr 2001
    Location
    Salt Lake City, UT
    Posts
    135

    Re: Why am I getting this error message - "-2147467259 cannot insert an empty row...."

    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

    "There are no stupid questions, but there are a lot of inquisitive idiots."

  6. #6
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Why am I getting this error message - "-2147467259 cannot insert an empty row...."

    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
    [email protected]
    Iouri Boutchkine
    [email protected]

  7. #7
    Join Date
    Apr 2001
    Location
    Salt Lake City, UT
    Posts
    135

    Re: Why am I getting this error message - "-2147467259 cannot insert an empty row...."

    Thanks - I'll try that.

    :-)
    AD

    "There are no stupid questions, but there are a lot of inquisitive idiots."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured