How to Create Dynamic Tables in MS-Access?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kalkotarmr
    New Member
    • Oct 2007
    • 1

    How to Create Dynamic Tables in MS-Access?

    How to Create Dynamic Tables in MS-Access?

    I will just pass the Arguments and the Code will Create the tables dynamically/run-time.
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    You can use create table key word to create table like

    [CODE=sql]CREATE TABLE tblTableName (lngNumericFiel dName Long, strTextFieldNam e TEXT)[/CODE]

    Comment

    • Scott Price
      Recognized Expert Top Contributor
      • Jul 2007
      • 1384

      #3
      Sorry Hari, but that doesn't work with Access/VBA. The syntax for a make-table query is:

      SELECT [ALL:DISTINCT] select_list
      INTO new_table
      FROM source_table
      [WHERE criteria ]

      This can be run from VBA using the DoCmd.RunSQL command.

      Regards,
      Scott

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by Scott Price
        Sorry Hari, but that doesn't work with Access/VBA. The syntax for a make-table query is:
        Okay No problem, But that query is common to all Database which will create table dynamically.

        Comment

        • Scott Price
          Recognized Expert Top Contributor
          • Jul 2007
          • 1384

          #5
          Originally posted by hariharanmca
          Okay No problem, But that query is common to all Database which will create table dynamically.
          Actually it uses standard SQL language. However, Access uses a version of SQL that MS has 'optimized' for their own purposes. It's called Jet SQL, after the Jet database engine that MS Access has been using (at least up till A2003).

          Regards,
          Scott

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Okay that's good information. Thank you to share with me.

            Comment

            • FishVal
              Recognized Expert Specialist
              • Jun 2007
              • 2656

              #7
              Hi, everyone.

              Actually Access does support CREATE TABLE statement.

              Comment

              • Scott Price
                Recognized Expert Top Contributor
                • Jul 2007
                • 1384

                #8
                Strangely enough, it does! Sorry Hari... I was under the impression that it didn't.

                Thanks for pointing it out, Fish.

                Regards,
                Scott

                Comment

                Working...