T
Tan SH
Hi,
I am currently using VB to create an application that uses
Access databases. The Microsoft Access version used
previously is Access 97 but I would like to update the
application for use with Access 2000.
My source code is as follow:
--------------------
Dim sFile As String
Dim dbtemp As Database
sFile = OpenDialog("Select Group Database", "Microsoft
Access (*.mdb)|*.mdb", False, False, sDPath)
If sFile <> "" Then
If Dir(sFile) <> "" Then
Set dbtemp = OpenDatabase(sFile, , True)
End If
End If
--------------------
The problem is that even though there is a value
for 'sFile' (the full dame of the Access file including
its path), the result of dbtemp is always 'nothing'.
This code works if sFile is an Access 97 file but would
not work if it is an Access 2000 file. The DAO library has
been included in the Access 2000 file.
Also, I notice that with an Access 2000 file, the DAO
library is usually not included by default. Is there a way
that I can make it available by default?
Thanks.
br/Tan
I am currently using VB to create an application that uses
Access databases. The Microsoft Access version used
previously is Access 97 but I would like to update the
application for use with Access 2000.
My source code is as follow:
--------------------
Dim sFile As String
Dim dbtemp As Database
sFile = OpenDialog("Select Group Database", "Microsoft
Access (*.mdb)|*.mdb", False, False, sDPath)
If sFile <> "" Then
If Dir(sFile) <> "" Then
Set dbtemp = OpenDatabase(sFile, , True)
End If
End If
--------------------
The problem is that even though there is a value
for 'sFile' (the full dame of the Access file including
its path), the result of dbtemp is always 'nothing'.
This code works if sFile is an Access 97 file but would
not work if it is an Access 2000 file. The DAO library has
been included in the Access 2000 file.
Also, I notice that with an Access 2000 file, the DAO
library is usually not included by default. Is there a way
that I can make it available by default?
Thanks.
br/Tan