Results 1 to 6 of 6

Thread: [RESOLVED] DataGrid Problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    10

    Resolved [RESOLVED] DataGrid Problem

    Hi all,

    I make a simple form in VB6 to input / edit Personal data.
    I use one Adodc and some commandbutton and text box.

    Everything is ok ( I can Add new, cancel , edit, etc).

    Then I add a Datagrid to the form only to show ID and Name.
    I use one Adodc for all of them.

    Everything is ok, except one :
    If I add a new record ( adodc1.recordset.addnew), then
    I cancel it ( adodc1.recordset.cancelUpdate ) , an error message appear :
    ... they would create duplicate value in index, primary key ........

    My database have primary dan index, but in this case I don't make any new record.

    Can anyone please tell me how to avoid this error ?

    Thank you
    Rudy Ong

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: DataGrid Problem

    What is the Cursor Type You are Using?

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    10

    Re: DataGrid Problem

    I use OpenDynamic.

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: DataGrid Problem

    Try the lock type as LockBatchOptimistic

  5. #5
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: DataGrid Problem



    check out the Database Faq section:

    http://www.vbforums.com/showthread.php?t=337051
    CS

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    10

    Re: [RESOLVED] DataGrid Problem

    Thank you.
    It is working now.


    Rudy Ong

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