Code:
Public Function ZIPIT1()
Dim strAppName As String
Dim strZipFile As String
Dim strDbFile(7) As String
Dim Backup As String
Dim NewZip As String
On Error GoTo poruka
Backup = "C:\IC\FinancijskoBaza.mdb"
NewZip = Backup & ".rar"
'lokacija ZIP ili rar exe
strAppName = Me.ziprar
'ime ZIP ili rar koji radis
strZipFile = NewZip
strDbFile(1) = Me.Text1 & ""
strDbFile(2) = Me.Text2 & ""
strDbFile(3) = Me.Text3 & ""
strDbFile(4) = Me.Text4 & ""
strDbFile(5) = Me.Text5 & ""
strDbFile(6) = Me.Text6 & ""
strDbFile(7) = Me.Text7 & ""
Call Shell(strAppName & " a " & strZipFile & " " & strDbFile(1) & " " & _
strDbFile(2) & " " & strDbFile(3) & " " & strDbFile(4) & " " & _
strDbFile(5) & " " & strDbFile(6) & " " & strDbFile(7), 1)
Call EmailCDONTS
Exit Function
poruka:
Eval ("MsgBox (' Zaštita nije obavljena . Svi parametri nisu zadovoljeni. @ Pozovite svog system administratora da otkloni grešku. @@',30,' UPOZORENJE')")
End Function
Public Function ZIPIT1()
Dim strAppName As String
Dim strZipFile As String
Dim strDbFile(7) As String
Dim Backup As String
Dim NewZip As String
On Error GoTo poruka
Backup = "C:\IC\FinancijskoBaza.mdb"
NewZip = Backup & ".rar"
'lokacija ZIP ili rar exe
strAppName = Me.ziprar
'ime ZIP ili rar koji radis
strZipFile = NewZip
strDbFile(1) = Me.Text1 & ""
strDbFile(2) = Me.Text2 & ""
strDbFile(3) = Me.Text3 & ""
strDbFile(4) = Me.Text4 & ""
strDbFile(5) = Me.Text5 & ""
strDbFile(6) = Me.Text6 & ""
strDbFile(7) = Me.Text7 & ""
Call Shell(strAppName & " a " & strZipFile & " " & strDbFile(1) & " " & _
strDbFile(2) & " " & strDbFile(3) & " " & strDbFile(4) & " " & _
strDbFile(5) & " " & strDbFile(6) & " " & strDbFile(7), 1)
Call EmailCDONTS
Exit Function
poruka:
Eval ("MsgBox (' Zaštita nije obavljena . Svi parametri nisu zadovoljeni. @ Pozovite svog system administratora da otkloni grešku. @@',30,' UPOZORENJE')")
End Function
Code:
Function EmailCDONTS()
'If you are using NT or 2000 as an OS then you can use CDONTS.
'It uses the SMTP Service to send mail directly.
'However the SMTP service must be running on the machine
'and the machine must have internet access.
'You add a reference to "Microsoft CDO for Exchange 2000 Library" :
Dim oEmail As New CDO.message
oEmail.From = "[email protected]"
oEmail.To = "[email protected]"
oEmail.TextBody = "Pozdrav"
oEmail.AddAttachment "C:\IC\FinancijskoBaza.mdb.rar"
oEmail.Send
End Function
Function EmailCDONTS()
'If you are using NT or 2000 as an OS then you can use CDONTS.
'It uses the SMTP Service to send mail directly.
'However the SMTP service must be running on the machine
'and the machine must have internet access.
'You add a reference to "Microsoft CDO for Exchange 2000 Library" :
Dim oEmail As New CDO.message
oEmail.From = "[email protected]"
oEmail.To = "[email protected]"
oEmail.TextBody = "Pozdrav"
oEmail.AddAttachment "C:\IC\FinancijskoBaza.mdb.rar"
oEmail.Send
End Function
Ovo dobro radi s tim da sam morao instalirat na računalo Free SMTP Server.Radi se o nazivu rar-a.Kad neko primi poruku sa ovim atachom i na hotmail,g-mail misli da je virus,onda je stavi u Junk ili javlja da ima virus u ovom atachmentu.
Problem je izgleda u pravljanju rar-a:
Backup = "C:\IC\FinancijskoBaza.mdb"
NewZip = Backup & ".rar"
Ovaj je backup problem
miro