0

i'm working on a project with Visual Studio (vb .net) and an Access database. I need to change some of the tables/columns in my database, so i just went into the .accdb file and changed some stuff. now the question is how do i apply these changes to my existing database in Visual Studio? Do i have to remove the existing database and re-add the modified one? This makes a lot of mess with the auto-generated code of Visual Studio, and then i need to fix it manually - not ideal at all. Is there another, more elegant way of doing it?

Thank you

moonlander
  • 143
  • 2
  • 8
  • The very first time that I used a database (SQL or Access) with Visual Studio, I let VS handle all the dirty work. I ran into a similar problem to yours, and since then I just write all the queries and do everything with my own code. Much easier to manage IMO – rwisch45 Jul 13 '13 at 03:16
  • I totally agree, but how? how can i access to an .accdb file without importing it as a "database" in visual studio? – moonlander Jul 13 '13 at 11:03
  • Possible duplicate of http://stackoverflow.com/questions/17002768/dataset-designer-vb-does-not-get-updated/17013081#17013081 – Chris Jul 13 '13 at 11:21
  • You just do OLeDB queries to the .accdb file. You just need to know the path of the database. In my case it's usually just the Application.StartupPath – rwisch45 Jul 13 '13 at 15:09
  • Well, i'm not familiar with enough ULeDB commands, and anyway i'm too far out into the project to change it all. But i'm definitely going to do this next time! Is there a good website with ULeDB commands and examples? – moonlander Jul 13 '13 at 20:29

1 Answers1

0

If you did something to your columns in your DB especially Insert .. so should change your code if access the column/field by column index .. but if you access them by column name, you shouldn't make any big changes ..

matzone
  • 5,703
  • 3
  • 17
  • 20
  • Yes of course i will change any code that relies on tables/columns that i deleted from the .accdb file. But the thing is that visual studio doesn't "see" the changes i made to the .accdb file. If i go to database->tables i only see the tables from before i made the changes. – moonlander Jul 13 '13 at 11:01