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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Delete record using ADODC in vb6

Delete record using ADODC in vb6

Scheduled Pinned Locked Moved Visual Basic
helpdatabase
4 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.
  • O Offline
    O Offline
    offroaderdan
    wrote on last edited by
    #1

    Experts i have mostly figured out the code i need howevr am slightly stuck! I have a database which works fine, i want to delete a record that i have highlighted, code :

    dim lbk as long
    lbk = Adodc2.recordset.bookmark
    Adodc2.refresh
    Adodc2.recordset.move lbk
    Adodc2.recordet.delete

    This code will delete the last record and not the record selected :( Im sure that there is something little in this code which isn't working, if anybody can help that would be great Cheers Dan

    E 1 Reply Last reply
    0
    • O offroaderdan

      Experts i have mostly figured out the code i need howevr am slightly stuck! I have a database which works fine, i want to delete a record that i have highlighted, code :

      dim lbk as long
      lbk = Adodc2.recordset.bookmark
      Adodc2.refresh
      Adodc2.recordset.move lbk
      Adodc2.recordet.delete

      This code will delete the last record and not the record selected :( Im sure that there is something little in this code which isn't working, if anybody can help that would be great Cheers Dan

      E Offline
      E Offline
      Estys
      wrote on last edited by
      #2

      offroaderdan wrote:

      Adodc2.recordset.move lbk

      should be :

      Adodc2.recordset.bookmark = lbk

      Are you sure the type of lbk is long?

      O 1 Reply Last reply
      0
      • E Estys

        offroaderdan wrote:

        Adodc2.recordset.move lbk

        should be :

        Adodc2.recordset.bookmark = lbk

        Are you sure the type of lbk is long?

        O Offline
        O Offline
        offroaderdan
        wrote on last edited by
        #3

        Thanks for that. However it comes up with run time error 3001, in conflict.... ummm just so i read your post write the code should go

        dim lbk as long
        lbk = Adodc2.Recordset.bookmark ' same as below
        Adodc2.refresh
        Adodc2.recordset.bookmark = lbk ' this is near enough repeated
        adodc2.recordset.delete

        Thanks again for the reply :) and yeah i am sure that lbk is long as it will delete a record but not the one i want!

        E 1 Reply Last reply
        0
        • O offroaderdan

          Thanks for that. However it comes up with run time error 3001, in conflict.... ummm just so i read your post write the code should go

          dim lbk as long
          lbk = Adodc2.Recordset.bookmark ' same as below
          Adodc2.refresh
          Adodc2.recordset.bookmark = lbk ' this is near enough repeated
          adodc2.recordset.delete

          Thanks again for the reply :) and yeah i am sure that lbk is long as it will delete a record but not the one i want!

          E Offline
          E Offline
          Estys
          wrote on last edited by
          #4

          I seem to remember that the Bookmark property is a variant

          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