none
Reflect the updated Access Field type on VB.net form RRS feed

  • Question

  • Hi All,
    Can anyone advise me how I can reflect the updated Access Field type in my case from User Number to Autonumber on VB.net 2010 form without detaching and then reattaching the MS Access Database 2013 from scratch.

    Thanks in advance.

    Sunday, February 26, 2017 1:03 PM

All replies

  • Hello,

    What do you mean by "reflect" ?

    Assuming "User Number" is as field, do you want to change it from my type (and which type is it now) to Auto number?

    What do you mean by detach and reattach?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, February 26, 2017 1:48 PM
    Moderator
  • Hi Karen,

    Thank you for your prompt response

    When I changed the type of MS Access Type from User Number to Autonumber, this update can't be reflected / shown in the existing VB.Net form completely .

    but if I add new Windows form to be linked with a selected DB table, I show the Autonumber is working properly on new form and I need to avoid to build my form from scratch.

    Sunday, February 26, 2017 2:24 PM
  • Going with what I know about MS-Access (I generally deal with SQL-Server) is as follows.

    Let's say I have Id as a number then want to change it to a auto-incrementing primary key, I need to drop that field and add a new field, let's call it Identifier and when doing so if Id had values they need to be removed.

    In the form, remove the field Id.

    Once this is done you go into the xsd, right click on the table, select configure, Hit Next, Next, Finished. Now the classes are regenerated. 

    Now you can add the Identifier field to the form.

    I did the above to ensure it worked for me and it did work just fine.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, February 26, 2017 3:03 PM
    Moderator
  • Karen,

    You know it. You and Paul have answered it hundred times.

    @@Identity. 

    I won't tell more, you may do it complete

    Maybe because I always tell not to use it because it gives concurrency errors but probably this is a single user database.

    :-)


    Success
    Cor


    Sunday, February 26, 2017 3:18 PM