Access Field Types

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

    Access Field Types

    OK, before you flame me because this is not an VB/ADO/INTEROP question
    rather than a VB.NET/ADO.NET/Interop question, I have not had much luck with
    this so you guys are a last resort.

    I wonder is someone could help me. We have an Access DB which has a field
    type/size we need to change programatically .

    I'm sure this can be done via interop, does anyone have a code snippet or
    link which would help.

    Cheers


  • OHM

    #2
    Re: Access Field Types

    Because the customer has the database, but not the access application.
    Therfore, we need to generate a service pack to update not only code over
    hundreds of sites, but also the Access Tables.

    As the tables are full of data, I dont want to delete and recreate the
    fields. However, I know a work around is to create a new field, do an action
    query and then delete the old column of data, but I want to to this like
    access would.

    Regards - OHM




    "eh" <anonymous@disc ussions.microso ft.com> wrote in message
    news:E8995B95-12FF-410B-BB2F-E31BC846D362@mi crosoft.com...[color=blue]
    > could you explain why you want to do this?[/color]


    Comment

    • Ken Tucker [MVP]

      #3
      Re: Access Field Types

      Hi,

      I know alter table will do what you want with a sql server
      database not sure if it works with access.



      Ken
      ---------------------
      "OHM" <Me@NoWhere.Com > wrote in message
      news:uHt33P3MEH A.2064@TK2MSFTN GP12.phx.gbl...[color=blue]
      > OK, before you flame me because this is not an VB/ADO/INTEROP question
      > rather than a VB.NET/ADO.NET/Interop question, I have not had much luck
      > with
      > this so you guys are a last resort.
      >
      > I wonder is someone could help me. We have an Access DB which has a field
      > type/size we need to change programatically .
      >
      > I'm sure this can be done via interop, does anyone have a code snippet or
      > link which would help.
      >
      > Cheers
      >
      >[/color]


      Comment

      • OHM

        #4
        Re: Access Field Types

        I kind of gathered this, but didnt want to use this route. I was looking for
        an Interop solution really.

        Thanks anyway !

        Regards - OHM


        "eh" <anonymous@disc ussions.microso ft.com> wrote in message
        news:D96BBC5E-6EC1-4F6B-A11D-5580E72BB285@mi crosoft.com...[color=blue]
        > Im ***real*** rusty with Access but you should be able to drop columns and[/color]
        then create new ones programatically using access sql, then copy the data
        back from the backup you have made :-)[color=blue]
        >
        > hth[/color]


        Comment

        • OHM

          #5
          Re: Access Field Types

          Thanks Ken, was really looking for a more code based solution. In other
          words I want to do what access does, but do it via Interop. I cant find good
          material on this, Im sure its there, But I cant see it.

          Regards - OHM


          "Ken Tucker [MVP]" <vb2ae@bellsout h.net> wrote in message
          news:OgCHpF4MEH A.808@tk2msftng p13.phx.gbl...[color=blue]
          > Hi,
          >
          > I know alter table will do what you want with a sql server
          > database not sure if it works with access.
          >
          >[/color]
          http://msdn.microsoft.com/library/de...ALTERTABLE.asp[color=blue]
          >
          > Ken
          > ---------------------
          > "OHM" <Me@NoWhere.Com > wrote in message
          > news:uHt33P3MEH A.2064@TK2MSFTN GP12.phx.gbl...[color=green]
          > > OK, before you flame me because this is not an VB/ADO/INTEROP question
          > > rather than a VB.NET/ADO.NET/Interop question, I have not had much luck
          > > with
          > > this so you guys are a last resort.
          > >
          > > I wonder is someone could help me. We have an Access DB which has a[/color][/color]
          field[color=blue][color=green]
          > > type/size we need to change programatically .
          > >
          > > I'm sure this can be done via interop, does anyone have a code snippet[/color][/color]
          or[color=blue][color=green]
          > > link which would help.
          > >
          > > Cheers
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • William Ryan eMVP

            #6
            Re: Access Field Types

            OHM:

            Are you trying to use Interop or avoid it? AFAIK, you'll need to use DAO to
            fire those changes with access.
            "OHM" <Me@NoWhere.Com > wrote in message
            news:uHt33P3MEH A.2064@TK2MSFTN GP12.phx.gbl...[color=blue]
            > OK, before you flame me because this is not an VB/ADO/INTEROP question
            > rather than a VB.NET/ADO.NET/Interop question, I have not had much luck[/color]
            with[color=blue]
            > this so you guys are a last resort.
            >
            > I wonder is someone could help me. We have an Access DB which has a field
            > type/size we need to change programatically .
            >
            > I'm sure this can be done via interop, does anyone have a code snippet or
            > link which would help.
            >
            > Cheers
            >
            >[/color]


            Comment

            • Peter Huang

              #7
              RE: Access Field Types

              Hi,

              I have reviewed the newsgroup and find that you have post a similar post in
              the group below.

              Subject: Changing Field Type On MS Access using ADO/VB
              Newsgroups: microsoft.publi c.vb.database.a do

              I think Gary's suggestion in the group above that to use the ADOX to do the
              job is an approach.
              Also because ADOX is an COM object we can use it in .NET easier by simply
              adding reference to the ADOX library and the VS.NET will generate the
              assembly which is used to interop with ADOX COM object automatically.
              e.g.
              1. right click on the reference in the solution explorer and select add
              reference
              2. in the Add reference dialog select the COM tab and select the Microsoft
              ADO Ext. 2.7 for DDL and Security COM library and click OK

              After that we can use the ADOX object in VB.NET similar with what will do
              in VB6, you may follow the link that Gary provided.

              If you still have any concern on this issue, please feel free to post here.

              Best regards,

              Peter Huang
              Microsoft Online Partner Support

              Get Secure! - www.microsoft.com/security
              This posting is provided "AS IS" with no warranties, and confers no rights.

              Comment

              • OHM

                #8
                Re: Access Field Types

                Thank you, this infomation along with Gary's was most helpful. Also thanks
                to everyone else who has replied to my original post.

                Best Regards - OHM


                ""Peter Huang"" <v-phuang@online.m icrosoft.com> wrote in message
                news:GZIXCE%23M EHA.308@cpmsftn gxa10.phx.gbl.. .[color=blue]
                > Hi,
                >
                > I have reviewed the newsgroup and find that you have post a similar post[/color]
                in[color=blue]
                > the group below.
                >
                > Subject: Changing Field Type On MS Access using ADO/VB
                > Newsgroups: microsoft.publi c.vb.database.a do
                >
                > I think Gary's suggestion in the group above that to use the ADOX to do[/color]
                the[color=blue]
                > job is an approach.
                > Also because ADOX is an COM object we can use it in .NET easier by simply
                > adding reference to the ADOX library and the VS.NET will generate the
                > assembly which is used to interop with ADOX COM object automatically.
                > e.g.
                > 1. right click on the reference in the solution explorer and select add
                > reference
                > 2. in the Add reference dialog select the COM tab and select the Microsoft
                > ADO Ext. 2.7 for DDL and Security COM library and click OK
                >
                > After that we can use the ADOX object in VB.NET similar with what will do
                > in VB6, you may follow the link that Gary provided.
                >
                > If you still have any concern on this issue, please feel free to post[/color]
                here.[color=blue]
                >
                > Best regards,
                >
                > Peter Huang
                > Microsoft Online Partner Support
                >
                > Get Secure! - www.microsoft.com/security
                > This posting is provided "AS IS" with no warranties, and confers no[/color]
                rights.[color=blue]
                >[/color]


                Comment

                Working...