POR FAVOR ME AJUDE A FAZER UM BACKUP....

DANDAN10 08/03/2004 18:40:42
#14524
Por favor alguem me ajude a fazer um backup dos dados de um banco de dados, ja tentei de tudo e não consigo...


Desde ja agradeço,


Daniel
USUARIO.EXCLUIDOS 08/03/2004 19:03:50
#14534
Resposta escolhida
Pegue o componente ARJ na net e cole este codigo:
em um form e comandbutton e um drivelistbox:
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Declare Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" (ByVal lpszShortPath As String, ByVal lpszLongPath As String, ByVal cchBuffer As Long) As Long

Const MAX_PATH = 260

Public Function ShortPathName(ByVal FileName As String) As String

Dim length As Long, res As String

res = String$(MAX_PATH, 0)
length = GetShortPathName(FileName, res, Len(res))
If length Then
ShortPathName = Left$(res, length)
End If

End Function

Public Function LongPathName(ByVal FileName As String) As String

Dim length As Long, res As String
On Error Resume Next

res = String$(MAX_PATH, 0)
length = GetLongPathName(FileName, res, Len(res))
If length And Err = 0 Then
LongPathName = Left$(res, length)
End If

End Function
Private Sub Command1_Click()

Dim APPNAME As String
Dim MyPath As String

MyPath = App.Path
If Right(MyPath, 1) "\" Then MyPath = MyPath & "\"

APPNAME = MyPath & "ARJ A -VA " & A1 & "BACKUP " & ShortPathName(MyPath & "tiroalvo.MDB") 'aqui voce devera informar o nome do seu banco de dados ou arquivos que você queira compactar
X = Shell(APPNAME, 1)


End Sub
Private Sub Command2_Click()
Unload Me
End Sub

Tópico encerrado , respostas não são mais permitidas