How to create a new table at runtime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Talihomz
    New Member
    • Jan 2008
    • 11

    How to create a new table at runtime

    Hi.I was making a program that gets a clients id number and uses it to create a new record,named by a clients id.How do i create a Visdat table at runtime.Am using the ADO object to control the database.
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by Talihomz
    Hi.I was making a program that gets a clients id number and uses it to create a new record,named by a clients id.How do i create a Visdat table at runtime.Am using the ADO object to control the database.
    What database are you using? Why don't try using Create keyword?

    Rey Sean

    Comment

    • Talihomz
      New Member
      • Jan 2008
      • 11

      #3
      Am using Visual Data or rather the mdb database format.How do i use create

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        You are trying to create a new table or new record in existing table ?

        Comment

        • Talihomz
          New Member
          • Jan 2008
          • 11

          #5
          Am trying to create a new table.Wat i mean is that for instance an existing table has client information like names,age,id number n other many details.This table is in another location lets say General Records folder.I want to create a table for each client that holds data in fields such as Date Logged On or Transaction Performed.The table for each client is created everytime a new client is registered and is on another location Client Data.How do i create the new tables for each client since each client can log on as many ties as possible?

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            You need to use ADOX .

            Comment

            • Talihomz
              New Member
              • Jan 2008
              • 11

              #7
              Can you please xpound more on tha ADOX.Do you mean the ADO component.How do i use it?

              Comment

              • dnb
                New Member
                • Jan 2008
                • 34

                #8
                Hi!!!!
                Try This query

                Private Sub Form_Load()

                Dim mqry As String
                mqry = "create table tablename(fieldname1 fieldtype,field name2 fieldtype)"
                cn.BeginTrans
                cn.Execute mqry
                cn.CommitTrans

                End Sub

                Comment

                • debasisdas
                  Recognized Expert Expert
                  • Dec 2006
                  • 8119

                  #9
                  Originally posted by Talihomz
                  Can you please xpound more on tha ADOX.Do you mean the ADO component.How do i use it?
                  Please find a related discussion here .

                  Comment

                  Working...