Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. vb6 adodc delete

vb6 adodc delete

Scheduled Pinned Locked Moved Visual Basic
helpdatabasecom
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amit Battan Ror
    wrote on last edited by
    #1

    i am using following code in vb6 Private Sub cmdDelete_Click() On Error GoTo DeleteErr With datPrimaryRS.Recordset .Delete .MoveNext If .EOF Then .MoveLast End With Exit Sub DeleteErr: MsgBox Err.Description End Sub but it give error: Insufficient key column information for updating or refreshing. it remove the data from datagrid but not from ms access database please help me battan20@gmail.com

    V 2 Replies Last reply
    0
    • A Amit Battan Ror

      i am using following code in vb6 Private Sub cmdDelete_Click() On Error GoTo DeleteErr With datPrimaryRS.Recordset .Delete .MoveNext If .EOF Then .MoveLast End With Exit Sub DeleteErr: MsgBox Err.Description End Sub but it give error: Insufficient key column information for updating or refreshing. it remove the data from datagrid but not from ms access database please help me battan20@gmail.com

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      hi Amit Battan Ror Have you initiated a Development in vb6? If so,VB6 its Dead incase you dont know. Try to learn C# or vb.net.If your Company is Still Planning to keep vb6 apps and you have to maintain them, start sending out your resume because you are going to kill your skills. Now lets get back to your error.To update a Database record.. the Server has to know exactly which record it is that you want to change.. ie. it needs a UNIQUE key of some kind to process the record. IF in your DataBase table you do NOT define a field as being unique, ADO will look at the data and then try to build a (temporary)UNIQUE key.. which then can be used to perform the update. Sometimes ADO is successful in doing this.. and sometimes it is NOT (as witnessed by your present dilemna).The first thing you should do is go and check the Tables you are using to make sure that each of them has at least ONE unique field defined.. and if there is none.. add a Unique identifyling field (such as an Autonumber) to it. Hope it helps

      Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

      1 Reply Last reply
      0
      • A Amit Battan Ror

        i am using following code in vb6 Private Sub cmdDelete_Click() On Error GoTo DeleteErr With datPrimaryRS.Recordset .Delete .MoveNext If .EOF Then .MoveLast End With Exit Sub DeleteErr: MsgBox Err.Description End Sub but it give error: Insufficient key column information for updating or refreshing. it remove the data from datagrid but not from ms access database please help me battan20@gmail.com

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        Go to the table that you want to Update and make sure that there is a Primary_key, What database are you using?, Send me a Structure and will help you.

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups