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. how to make new database through ado ?

how to make new database through ado ?

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

    i had made a program in which i had executed "inser, delete and modify " command of SQL but can anybody tell me how to make new database, new table in a database and alter table queries code will me more helpful

    C 1 Reply Last reply
    0
    • S sumit21

      i had made a program in which i had executed "inser, delete and modify " command of SQL but can anybody tell me how to make new database, new table in a database and alter table queries code will me more helpful

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      sumit21 wrote: but can anybody tell me how to make new database, new table in a database and alter table queries To create a database, use something like this:

      CREATE DATABASE Sales
      ON
      ( NAME = Sales_dat,
      FILENAME = 'c:\program files\microsoft sql server\mssql\data\saledat.mdf',
      SIZE = 10,
      MAXSIZE = 50,
      FILEGROWTH = 5 )
      LOG ON
      ( NAME = 'Sales_log',
      FILENAME = 'c:\program files\microsoft sql server\mssql\data\salelog.ldf',
      SIZE = 5MB,
      MAXSIZE = 25MB,
      FILEGROWTH = 5MB )

      To create a table use something like this:

      CREATE TABLE publishers
      (
      pub_id char(4) NOT NULL
      CONSTRAINT UPKCL_pubind PRIMARY KEY CLUSTERED,
      pub_name varchar(40) NULL,
      city varchar(20) NULL,
      state char(2) NULL,
      country varchar(30) NULL
      DEFAULT('USA')
      )

      To alter a table use something like this:

      ALTER TABLE doc_exa ADD column_b VARCHAR(20) NULL

      If this is not enough help there are already some great documentation and articles already out there on the internet: CREATE DATABASE[^] CREATE TABLE[^] ALTER TABLE[^]


      My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

      S 1 Reply Last reply
      0
      • C Colin Angus Mackay

        sumit21 wrote: but can anybody tell me how to make new database, new table in a database and alter table queries To create a database, use something like this:

        CREATE DATABASE Sales
        ON
        ( NAME = Sales_dat,
        FILENAME = 'c:\program files\microsoft sql server\mssql\data\saledat.mdf',
        SIZE = 10,
        MAXSIZE = 50,
        FILEGROWTH = 5 )
        LOG ON
        ( NAME = 'Sales_log',
        FILENAME = 'c:\program files\microsoft sql server\mssql\data\salelog.ldf',
        SIZE = 5MB,
        MAXSIZE = 25MB,
        FILEGROWTH = 5MB )

        To create a table use something like this:

        CREATE TABLE publishers
        (
        pub_id char(4) NOT NULL
        CONSTRAINT UPKCL_pubind PRIMARY KEY CLUSTERED,
        pub_name varchar(40) NULL,
        city varchar(20) NULL,
        state char(2) NULL,
        country varchar(30) NULL
        DEFAULT('USA')
        )

        To alter a table use something like this:

        ALTER TABLE doc_exa ADD column_b VARCHAR(20) NULL

        If this is not enough help there are already some great documentation and articles already out there on the internet: CREATE DATABASE[^] CREATE TABLE[^] ALTER TABLE[^]


        My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

        S Offline
        S Offline
        sumit21
        wrote on last edited by
        #3

        i m using ms-access as database so, plz tell is there any method thnks

        C 1 Reply Last reply
        0
        • S sumit21

          i m using ms-access as database so, plz tell is there any method thnks

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          sumit21 wrote: i m using ms-access as database Well, why didn't you say?! I don't know about creating a database, but as for creating and altering tables there is good documentation with MS Access that has many examples. (Adding the search terms "Access" or "Microsoft Access" to the google queries I gave would most likely return the correct documentation also)


          My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

          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