hi everybody
Please I want a code to convert database from accdb to accde
thanks a lot
Please I want a code to convert database from accdb to accde
thanks a lot
'MakeMDE() creates an *DE file from an *DB file.
Public Function MakeMDE(strDB As String _
, Optional ByVal strDBTo As String = "" _
, Optional ByVal strPW As String = "") As Boolean
Dim appAcc As Access.Application
On Error GoTo ErrorHandler
If strDBTo = "" Then strDBTo = Left(strDB, Len(strDB) - 1) & "e"
If Exist(strFile:=strDBTo) Then
SetAttr strDBTo, vbNormal
Kill strDBTo
End If
Set appAcc = New Access.Application
With appAcc
Call AppWindowState(.Application, AppWindowState(Application))
If strPW > "" Then SendKeys strPW & "~"
Call .SysCmd(603, strDB, strDBTo)
Call .Quit
End With
Set appAcc = Nothing
MakeMDE = Exist(strDBTo)
ErrorHandler:
If Not appAcc Is Nothing Then Call appAcc.Quit
End Function
'Exist() returns true if strFile exists. By default ignores folders.
'22/05/2003 Rewritten with better code.
'20/05/2005 Added finding of R/O, System & Hidden files.
'11/12/2012 Added handling of inaccessible drives.
'22/05/2013 Added code to avoid false positives for folders.
Public Function Exist(ByVal strFile As String _
, Optional intAttrib As Integer = vbReadOnly _
Or vbHidden _
Or vbSystem) As Boolean
On Error Resume Next
'Strip trailing "\" characters as this gives a false reading.
If Right(strFile, 1) = "\" Then strFile = Left(strFile, Len(strFile) - 1)
Exist = (Dir(PathName:=strFile, Attributes:=intAttrib) <> "")
End Function
Comment