Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 VB6 + SQL Database update

Author  Topic 

Nikel
Starting Member

4 Posts

Posted - 2011-12-26 : 09:39:37
Hi, I have an application written in VB6 that connects to a db using SQL Server 2000, and I want to add a few fields (and modify related SP's) to a couple of tables.

I tried adding the new fields using SQL Managment Studio 2008 R2, but then when I run the app I get an "access denied" message. What I did was stop the SQL 2000 service, copy the .mdf file, make the changes and then copy it back, and re-start the server service.

Could anyone tell me how to properly export->modify->import a db so that the changes I make to it are "legal"? It would sound logical that the SQL interface will not tolerate changes to any db so easy.

Can I make those changes directly from the VB6 app, so that the app takes care of itself if fields are missing?

Thank you for any help!

_____
Nikel

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-12-26 : 10:19:51
Not clear to me how you were able to make changes to the MDF file. I am not at all familiar with that and don't know anyone who has successfully (or unsuccessfully) attempted that.

What you should do is connect to the database (while the server is running and database is online) using SQL Server Management Studio and add the columns to the table using T-SQL scripts or the table designer (accessible from the object explorer by right clicking on the table name)

Didn't get what you meant by export->modify->import. If you want to move the database to a different server, the safest way is perhaps to back up the database on the source server and restore the backup on the target server.
Go to Top of Page

Nikel
Starting Member

4 Posts

Posted - 2011-12-26 : 13:36:47
Hi, thanks for the reply. I connected to the db in Studio 2008 to make the changes to it using (as you said) the table designer. That's how I modified the .mdf file. The original db was in one machine and I made the changes on another one. What I did now is install SQL Server Management Studio Express on the target machine and make the changes locally. That worked so far, I could make the changes without any errors when launching the app. Probably didn't work before because I didn't copy the .log file?

With export-modify-import I meant exactly what you say, back up and restore. Sorry, new to the terminology =)
My problem now is to add a new SP to manage the newly added fields, but that's for another topic.

_____
Nikel
Go to Top of Page
   

- Advertisement -