Adding Columns to Jet/Access database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • johnb41

    #1

    Adding Columns to Jet/Access database

    I need to Add, delete, rename, etc columns in my Jet/Access database in
    my app.

    I know I can add columns for a dataset, and work with it, but as far as
    I know there is no way to push the added table to the original database
    via .NET.

    Is there something I'm missing from ADO.NET that allows this? Or do I
    have to use the SQL syntax for adding and editing columns?

    Thanks for your help!

    John

  • Cor Ligthert

    #2
    Re: Adding Columns to Jet/Access database

    John,

    To do what you ask, you n can do using SQL statements (strings) those are
    executed with

    OleDbcommand.ex ecutenonquery

    On this page are the SQL commands from access very complete described.

    http://msdn.microsoft.com/library/de.../acfundsql.asp

    http://msdn.microsoft.com/library/de...l/acintsql.asp

    http://msdn.microsoft.com/library/de...l/acadvsql.asp

    I hope this helps a little bit?

    Cor


    Comment

    • Armin Zingler

      #3
      Re: Adding Columns to Jet/Access database

      "johnb41" <orders@informa tik.com> schrieb[color=blue]
      > I need to Add, delete, rename, etc columns in my Jet/Access database
      > in my app.
      >
      > I know I can add columns for a dataset, and work with it, but as far
      > as I know there is no way to push the added table to the original
      > database via .NET.
      >
      > Is there something I'm missing from ADO.NET that allows this? Or do
      > I have to use the SQL syntax for adding and editing columns?
      >
      > Thanks for your help!
      >[/color]

      There is no VB language keyword for this. Please note that there is an
      ADO.Net newsgroup for language unrelated questions: m.p.d.framework .adonet


      Armin

      Comment

      • Cor Ligthert

        #4
        Re: Adding Columns to Jet/Access database

        > There is no VB language keyword for this. Please note that there is an[color=blue]
        > ADO.Net newsgroup for language unrelated questions: m.p.d.framework .adonet
        >[/color]
        cmd.ExecuteNonQ uery

        (without a semicolumn otherwise it is C#)

        :-)

        The rest is Adonet.

        :-)

        Cor


        Comment

        • Armin Zingler

          #5
          Re: Adding Columns to Jet/Access database

          "Cor Ligthert" <notmyfirstname @planet.nl> schrieb[color=blue][color=green]
          > > There is no VB language keyword for this. Please note that there
          > > is an ADO.Net newsgroup for language unrelated questions:
          > > m.p.d.framework .adonet
          > >[/color]
          > cmd.ExecuteNonQ uery
          >
          > (without a semicolumn otherwise it is C#)
          >
          > :-)
          >
          > The rest is Adonet.
          >
          > :-)[/color]

          I'm sure he knows how to call a procedure in VB.

          :)

          Armin

          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: Adding Columns to Jet/Access database

            "Cor Ligthert" <notmyfirstname @planet.nl> schrieb:[color=blue][color=green]
            >> There is no VB language keyword for this. Please note that there is an
            >> ADO.Net newsgroup for language unrelated questions:
            >> m.p.d.framework .adonet
            >>[/color]
            > cmd.ExecuteNonQ uery
            >
            > (without a semicolumn otherwise it is C#)[/color]

            Yeah, but hopefully with '()' on the end (although this is not mandatory).

            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://classicvb.org/petition/>

            Comment

            • johnb41

              #7
              Re: Adding Columns to Jet/Access database

              Cor,

              Oh my god! Those articles go in depth. Who would have known SQL is so
              deep?! Those links are keepers, thanks!

              John

              Comment

              • johnb41

                #8
                Re: Adding Columns to Jet/Access database

                I searched all 3 links, and there is no command for "Renaming" a table.
                I searched the web, and SQL does have a Rename command. Is it not
                available for Jet/Access?

                Does anyone know how to rename a table in SQL for Jet/Access?

                Thanks,
                John

                Comment

                • Paul Clement

                  #9
                  Re: Adding Columns to Jet/Access database

                  On 29 Jun 2005 08:10:55 -0700, "johnb41" <orders@informa tik.com> wrote:

                  ¤ I searched all 3 links, and there is no command for "Renaming" a table.
                  ¤ I searched the web, and SQL does have a Rename command. Is it not
                  ¤ available for Jet/Access?
                  ¤
                  ¤ Does anyone know how to rename a table in SQL for Jet/Access?

                  I believe that only DAO can do this using the TableDefs collection.


                  Paul
                  ~~~~
                  Microsoft MVP (Visual Basic)

                  Comment

                  • Cor Ligthert

                    #10
                    Re: Adding Columns to Jet/Access database

                    John,

                    I hate SQL. For renaming or whatever is AFAIK used in that slang the word
                    "modify".

                    However the best change you have is to follow Armins advice and ask this
                    question in the newsgroep and otherwise follow Pauls advice.

                    Adonet
                    news://msnews.microsoft.com/microsof...amework.adonet

                    In that newsgroup are people when you awake them with a question about SQL
                    they have direct the answer.

                    I hope this helps,

                    Cor


                    Comment

                    • m.posseth

                      #11
                      Re: Adding Columns to Jet/Access database

                      Nope ,,, ADOX can do this to

                      and is not declared Obsolete by MS :-) as DAO is




                      "Paul Clement" <UseAdddressAtE ndofMessage@sws pectrum.com> schreef in bericht
                      news:1ff5c1lapb o3f324jteto9t4m hes5atvgs@4ax.c om...[color=blue]
                      > On 29 Jun 2005 08:10:55 -0700, "johnb41" <orders@informa tik.com> wrote:
                      >
                      > ¤ I searched all 3 links, and there is no command for "Renaming" a table.
                      > ¤ I searched the web, and SQL does have a Rename command. Is it not
                      > ¤ available for Jet/Access?
                      > ¤
                      > ¤ Does anyone know how to rename a table in SQL for Jet/Access?
                      >
                      > I believe that only DAO can do this using the TableDefs collection.
                      >
                      >
                      > Paul
                      > ~~~~
                      > Microsoft MVP (Visual Basic)[/color]


                      Comment

                      • Paul Clement

                        #12
                        Re: Adding Columns to Jet/Access database

                        On Sat, 2 Jul 2005 10:24:52 +0200, "m.posseth" <posseth@planet .nl> wrote:

                        ¤ Nope ,,, ADOX can do this to
                        ¤

                        Yeah it looks like you're correct. You can change it through the Name property:

                        Dim cat As New ADOX.Catalog

                        cat.ActiveConne ction = _
                        "Provider=Micro soft.Jet.OLEDB. 4.0;" & "Data Source=e:\My Documents\db1.m db;" & _
                        "Jet OLEDB:Engine Type=4"

                        cat.Tables("Tab leName").NAME = "NewTableNa me"

                        ¤ and is not declared Obsolete by MS :-) as DAO is

                        Actually they still support DAO. I've queried them on this recently. However, ADO/ADOX is
                        recommended under .NET if you need features not supported in ADO.NET.

                        AFAIK, there is no new development for either.


                        Paul
                        ~~~~
                        Microsoft MVP (Visual Basic)

                        Comment

                        Working...