|
-
Dec 19th, 2007, 12:55 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] do these database functions require Access Installed?
if i call for these functions to take place inside the mdb database backend from my VB frontend;
database compact & Repair
do they require that Access be installed on the client machines? if so what is an easy way to code into VB (classic) to check if Access is installed?
Cheers
-
Dec 19th, 2007, 04:54 AM
#2
Re: do these database functions require Access Installed?
No, I have a compact and repair routine in one of my apps that works fine with and without Access installed. I've included the code below. Hope this helps
vb Code:
Sub CompactDatabase()
Dim source_path As String
Dim Target_path As String
On Error Resume Next
'Compact Database
source_path = App.Path & "\" & SelectedDatabase
Target_path = App.Path & "\CompactResearch.mdb"
If compactDB(source_path, Target_path) = False Then
'Need to check if CompactDatabase.mdb is there because it needs to be deleted
If Dir$(Target_path) <> "" Then
Kill "" & Target_path & ""
End If
Else
Kill "" & source_path & ""
Name "" & Target_path & "" As "" & source_path & ""
End If
End Sub
Public Function compactDB(ByVal SOUR_path As String, ByVal DEST_path As String) As Boolean
On Error GoTo Err_compact
Dim JRO As New JRO.JetEngine
' Source and Destination connection path
Dim DB_sour As String, DB_dest As String
DB_sour = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & SOUR_path & "; Jet OLEDB:Database Password=XYZ123;"
DB_dest = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & DEST_path & "; Jet OLEDB:Database Password=XYZ123;"
DoEvents
'Compact Database
JRO.CompactDatabase DB_sour, DB_dest
compactDB = True
Exit Function
Err_compact:
compactDB = False
End Function
-
Dec 19th, 2007, 09:16 AM
#3
Re: do these database functions require Access Installed?
The only time you would need Access installed is if you were doing something that required the database itself to open such as calling a built in Access Report.
-
Dec 21st, 2007, 07:32 PM
#4
Thread Starter
Hyperactive Member
Re: do these database functions require Access Installed?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|