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. C#
  4. Create table

Create table

Scheduled Pinned Locked Moved C#
databasequestion
3 Posts 3 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.
  • J Offline
    J Offline
    Johan Russouw
    wrote on last edited by
    #1

    Hi I need to create new tables from my program in a Access database. I'm using the odbc components and sql queries to access the database. What would the query look like? Thanks

    G C 2 Replies Last reply
    0
    • J Johan Russouw

      Hi I need to create new tables from my program in a Access database. I'm using the odbc components and sql queries to access the database. What would the query look like? Thanks

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Something like: "create table Users (Id int primary key, Name varchar(100))" Look up the reference for the create table command for complete syntax. I would recommend using OleDb instead of OCDB, if possible. Also, creating tables is something that you would not normally do from code. If you feel that you need to add tables dynamically to add more data, most likely your database design is not flexible enough.

      --- b { font-weight: normal; }

      1 Reply Last reply
      0
      • J Johan Russouw

        Hi I need to create new tables from my program in a Access database. I'm using the odbc components and sql queries to access the database. What would the query look like? Thanks

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        I am unsure if you can just pass create table syntax to Access, or if you need to use ADOX.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        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