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. CommandBuilder Problem

CommandBuilder Problem

Scheduled Pinned Locked Moved Visual Basic
help
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.
  • P Offline
    P Offline
    Pasan148
    wrote on last edited by
    #1

    Is it possible to insert rows in to a MS Access table with a Auto number field using a CommandBuilder. I tried that but it's getting following error. Syntax error in Insert in to statement. I did same thing to a table which doesn't have a auto number field. It worked. I think the problem is that auto number field. What's the solution for this problem.

    D 1 Reply Last reply
    0
    • P Pasan148

      Is it possible to insert rows in to a MS Access table with a Auto number field using a CommandBuilder. I tried that but it's getting following error. Syntax error in Insert in to statement. I did same thing to a table which doesn't have a auto number field. It worked. I think the problem is that auto number field. What's the solution for this problem.

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      I believe the problem may be that you are trying to pass a value for the auto number field. That would cause the insert to fail. In your Insert statement, list the fields you want to include, but don't list the Autonumber field, then in your value clause list only the values which need to be inserted. remeber to vote :cool:

      P 1 Reply Last reply
      0
      • D David Mujica

        I believe the problem may be that you are trying to pass a value for the auto number field. That would cause the insert to fail. In your Insert statement, list the fields you want to include, but don't list the Autonumber field, then in your value clause list only the values which need to be inserted. remeber to vote :cool:

        P Offline
        P Offline
        Pasan148
        wrote on last edited by
        #3

        I didn't use any Insert statement. Just used CommandBuilder class to generate SQL statements

        D 1 Reply Last reply
        0
        • P Pasan148

          I didn't use any Insert statement. Just used CommandBuilder class to generate SQL statements

          D Offline
          D Offline
          David Mujica
          wrote on last edited by
          #4

          Check this article out ... I think you should be using a different method to manipulate the Access data. I have been using the System.Data.OleDb classes for MS-Access and they work fine. http://msdn.microsoft.com/en-us/library/ms971491.aspx[^] Remeber to vote.

          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