Hi All,

I need some help in understanding something.

I have an existing database and I make some changes in Sql Server Management Studio, how can I adapt those changes in the Visual Basic project.

As an example if I change a table name in Sql Server Management Studio how can I update that change in my VB project.

OR

Can I update the database directly from Visual Basic.

Learning these skills would be a huge advantage for me.

Any help would be much apreciated.

Thanks very much

John

Recommended Answers

All 2 Replies

The usual procedure is to finalize the database design (table and column names, etc) then code to that design. If the database design is incomplete then you'll just have to modify your code as changes occur. The only other option (at leas as I can tell) is to abstract the column and table names. By that I mean store the column and table names in a config file and read those names in at run time. As an example, the config file might contain lines like

CustomerInfoTable = cust_info
ProductInfoTable = prod_info
CustomerNumber = cust_no

read those values into variables at load time then create your queries dynamically as in

query = "select " & CustomerNumber & " from " & CustomerInfoTable " where..."

At least that way you would only have to change the config file as the database changes (except for major restructuring)

The usual procedure is to finalize the database design (table and column names, etc) then code to that design. If the database design is incomplete then you'll just have to modify your code as changes occur. The only other option (at leas as I can tell) is to abstract the column and table names. By that I mean store the column and table names in a config file and read those names in at run time. As an example, the config file might contain lines like

CustomerInfoTable = cust_info
ProductInfoTable = prod_info
CustomerNumber = cust_no

read those values into variables at load time then create your queries dynamically as in

query = "select " & CustomerNumber & " from " & CustomerInfoTable " where..."

At least that way you would only have to change the config file as the database changes (except for major restructuring)

Cheers Rev, sadley I am talking about database re structure and again you can only do it the long way round, like I did today, it took me 4 hours to add a couple of tables and change a column name, because I had to re-write the database in SQL Server Management Studio, then I had to implement the new database in my app. Never mind I guess some things are just meant to be done the long way round ;)

I like your idea about the config file though.

thanks again for your help mate.

John

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.