
VB4 Jet Engine Runtime Error 3196
I am using VB4 Professional 16 bit on Windows 3.1. I am new to the Jet
Engine relational database system. Taking one step at a time I am
writing a small book library system similar to biblio.mdb that comes
with VB4.
I have the following menu options :-
Create New Database
Open Existing Database
Close Database
Repair Database
I can create a database named by a user, open a daatabase and close the
database and they seem to work. However, when I run RepairDatabase I get
:-
Runtime error 3196
Couldn't use 'C:\TempDB\ABC.MDB'; database already in use.
I purchased Sheridan Data Widgets v2.0 and am using the VB data control
in conjunction with the Sheridan enhanced data control on my form.
I am sure it is something very simple that I am missing. It seems as
though the database I created or opened is not closing properly and is
still in memory and in use after I have clicked menFileClose menu
option.
My work is therapeutic as I am slowly recovering from a muscle disease
and therefore I am at home nearly all of the time. So I have no one to
seek advice from. I have worked through VB 4 Prof manuals and purchased
several expensive books on database programming but to no avail.
I have spent many days and combinations of lines of code trying to
resolve my problem.
In the menFileClose_Click() I have the following :-
Dyn.Close
MyDb.Close
Set Dyn1 = Nothing
Set MyDb = Nothing
frmDb.Data1.DatabaseName = ""
frmDb.Data1.RecordSource = ""
frmDb.SSDBData1.DataField = ""
I have tried to find a good example of creating, opening and closing a
database. Particularly where you create a new database and then leave it
in a state where you can start to add records.
I am blessed with patience but would be really glad of any guidance
anyone can be kind enough to give me.
Many thanks.
Gordon Smith