Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to update Access97 database with vb code

Status
Not open for further replies.

33216CLC

Programmer
Aug 17, 2000
173
BS
I have a VB6 program that connects to an Access 2000 database created in Access 97 format. Because of the cumbersome tasks involved in manually updating this database structure, I added and edited tables using VB code. Which worked out fine. However one of my user's (which had Access 2000) had to switch to another computer which has Access 97. When I sign on to my application the program runs a procedure to automatically update the database structure. However when I opened the database, the structure was not updated with the new table I had added - which was strange.

Is there some reason why the structure was updated with 2000 loaded and not with 97 loaded on the systems? I thought that since the database remains in 97 format it would not pose a problem.

Thanks
 
I am not sure that you are including all of the variables. For instance, was your application compiled and installed on the new machine, or was it run from within VB? Do both computers have the same OS? Are you sure that the path in your application points to the location of the database in the client's computer? Might be easier to find the problem with more info.

Hunter
 
Hunter,

Here are the variables:

1. The program was compiled in VB at my office on a Win98 computer with office 97 loaded, initially. We upgraded to Office 2000, but kept the 97 format(did not convert to 2000). I am presently working on this application, making changes when necessary, thus updating the database structure using the code placed in my vb program. This I have been able to do without a hitch. I then upgraded to to Win Me on my Development Machine. I was still able to do these updates with out a hitch, but because of other problems with ME, I moved to another computer that has Win2000, office 2000, Vb6, and the database format remains in Access 97 format. I am yet able to update the database structure automatically from my program without a hitch.

2. I installed the program on a client's computer that has WinNT 4.0 and office 97. I do not recall having problems with the automatic updating of the structure. The program was then loaded onto another NT 4.0 Machine, but this one had Office 2000. Again the automatic updates took place without a hitch. Something went wrong with the hard drive, so we had to Intall the program onto another NT. 4.0 Machine. This one has Office 97. When I ran the latest update of my program on this machine, I noticed that the database change that should have taken place did not take place.

I ran the very same updated program on my development machine and the updates were made without a hitch.

Thanks
 
Sorry Hunter,

I forgot something, the path of the database is in tact. If it was incorrect, the user would be unable to sign on to the program.

Here is a samble of the code I use in My Vb App to update the database:

Set dbs = DBEngine.Workspaces(0).OpenDatabase(MyDbPath, False, False, "; pwd=" & g_sPassword)

''''''''''edit table tranlog
Set tbl = dbs.TableDefs("tranlog")
With tbl
.Fields.Append .CreateField("field15", dbText, 30)
dbs.TableDefs.Append tbl
Set fld = .Fields("Field15")
fld.AllowZeroLength = True
End With


Thanks
 
When you installed the application that you wrote, did you use the "application deployment wizzard" to install the program, or did you simply copy the exe file to each computer? The app deployment wizzard will ensure that the Access 97 DLLs need by the program will be in place, if you did not, then your application is probably using the DLLs from what ever version of Access is installed on the machine where you are installing the exe, possibly causing compatibility problems that do not generate errors....
 
The same installation CD was used for all installations On all three computers(the deployment wizard was used to create this), but after installation I updated the exe file on several occasions and simply copied it onto their computer. I did the same on several occasions with all three computers, but I never had this problem till now.

What you are saying about the dlls does make sense though. I will reinstall the CD and see what happens. It could be that something went wrong during the last installation.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top