|
[ SLOJ.1973 @ 26.09.2008. 23:04 ] @
| Pozdrav.Napravio sam formu na kojoj se putem koda snima back end baze i isti šalje na mail (sve jednim klikom na komandno dugme u formi).Kako da zaštitim taj back end baze (tu usnimljenu poruku) jer će sadržati važne podatke jedne firme,a svakodnevno će se slati putem interneta? Znači treba da se takođe tim jednim klikom sve to odradi:snimanje back enda,nekakva zaštita istog,i slanje na mail? Prelistavao sam teme enkripcije i zaštite,ali nisam se snašao.Može li tako nešto da se odradi kroz Access ili VB cod? |
[ Getsbi @ 27.09.2008. 07:09 ] @
Možda da umesto spakovanog .mdb (koji je kontejner tipa) šalješ mail-om .xml datoteke. Izvoz u .xml na odpremnom mestu i uvoz u .mdb na prijemnom mestu je lagan i ostvariv putem VBA, a za enkripciju .xml datoteka važe sva pravila kao i za ostale tekstualne fajlove.
[ domaci_a_nas @ 27.09.2008. 09:29 ] @
A sa druge strane, postoji i besplatan program 7zip koji snima datoteku u ZIP formatu sa lozinkom, možeš mu preko Shell komande poslati putanju back enda i putanju arhive koju treba da napravi i onda tako zipovanu bazu pošalješ na mail. Tu bazu će posle moći da vidi samo neko ko zna šifru.
[ Catch 22 @ 27.09.2008. 10:36 ] @
^ Rade to i WinZip, kao i WinRAR...
Citat: WinRAR Example:
-p[p] Encrypt files with the string <p> as password while archiving.
The password is case-sensitive. If you omit the password on the
command line, you will be prompted with message "Enter password".
Example:
rar a -pmyhoney secret1 *.txt
add files *.txt and encrypt them with password "myhoney".
Both RAR and ZIP formats support encryption. To encrypt files you need to specify a password before archiving or directly in the Archive name and parameters dialog. In the command line this is done by using switch -p[pwd]. In WinRAR shell, to enter a password you may either press Ctrl+P or select the "Set default password" command in File menu or click on the small icon of a key in the bottom left corner of the WinRAR window. To enter a password in Archive name and parameters dialog press "Set password" button in "Advanced" set of options.
Unlike ZIP, RAR format allows to encrypt not only file data, but also other sensitive archive areas: file names, sizes, attributes, comments and other blocks. If you wish to do it, you need to set "Encrypt file names" option in the password dialog or in the command line mode use the switch -hp[pwd] instead of -p[pwd]. Without a password it is impossible to view even the list of files in archive encrypted in such mode.
Solid RAR archives and archives with encrypted file names can have only one same password for all archived files. Files in non-solid RAR archives without name encryption and in ZIP archives can use different passwords.
Do not forget to remove an entered password, when it is no longer needed, otherwise you may occasionally archive some files using the password without wishing to. To remove a password, enter an empty string instead of a password or close WinRAR and start it again. While a password exists, the icon of key is red, otherwise it will be yellow. Also, when you start an archive operation using a password, title bar of Archive name and parameters dialog flashes twice.
You do not need to remove a password if you entered it directly in Archive name and parameters dialog. Unlike other ways such password is valid only for the single archiving operation and automatically removed after its completion.
When extracting encrypted files, it is not necessary to enter the password before starting the operation, though you may do so. If a password was not entered before extraction and WinRAR encounters an encrypted file, the password will be requested from the user.
ZIP 2.0 format supported by WinRAR uses a proprietary encryption algorithm. RAR archives are encrypted by the much stronger AES-128 standard. If you need to encrypt sensitive information, it is better to select the RAR archive format. For real security use passwords of at least 8 characters in length. Do not use words of any language as passwords, it is better to choose a random combination of characters and digits. Note that passwords are case sensitive. Maximum password length for RAR archives is 127 characters. Longer passwords are truncated to this length.
Remember that if you lose your password, you will be unable to retrieve the encrypted files, not even the WinRAR author is able to extract encrypted files.
[ SLOJ.1973 @ 29.09.2008. 18:32 ] @
Izvinjavam se što se ranije nisam javio,ali sam bio u nekoj gužvi pa tek sad ugrabih malo vremena.Dobra je ovo ideja domaćeg,ali sam pomoću shell funkcije uspeo samo da pozovem recimo winrar ili winzip:
Code: Dim stAppName As String
stAppName = "C:\Program Files\WinRAR\WinRAR.exe"
Call Shell(stAppName, 1)
,ali mi ta opcija ne odgovara,jer neko tamo sada treba da petlja sa zipovanjem backenda i dodeljivanjem šifre istom.Da budem iskren,verovatno postoji kod koji to sve odrađuje u jednom kliku,ali ja ne umem da ga napišem.Prelistah dosta strana na internetu ali ne nađoh.Nadam se da me domaći neće opet slati u access obdanište.Što se tiče Getsbijevog odgovora,verovatno je to najlakše rešenje,ali mi je sada kasno da sve prepravljam,jer sam bazu već priveo kraju,a osvežavanje baze je zamišljeno (odrađeno) da radi pomoću flash diska i raznih append querija,kopiranja back enda najpre na flash a zatim se upoređuju tabele iz tog back enda i back enda servera,pa ako postoje razlike onda se pomoću append query-ja sve to lepo dopunjuje itd itd.Da ne bih sada sve pretvarao u .xml oblik ovaj predlog domaćeg bi mi najviše odgovarao.Nadam se da ću naći načina da pozivanje winrar-a,dodeljivanje putanje do back enda i njegovo arhiviranje i zaštitu šifrom uskoro nađem uz Vašu pomoć.Pozdrav.
[ Catch 22 @ 30.09.2008. 00:24 ] @
Evo ti na brzinu izvađen primer koji ja koristim, treba samo da dodaš naznačene stavke specifične za tvoju aplikaciju, kao i parametar za zaključavanje Winrar fajla...
Code:'Iskopirati donji kod u novi modul
'Koristi se za pakovanje fajla Data.mdb u podfolderu aplikacije \Data
'i slanje istog kao attachment-a u email poruci na zadatu adresu
'Postavke izmeniti po želji i potrebama
Option Explicit
Option Compare Database
Dim fsObject As Object
Dim strDBPath As String
Dim strDBFile As String
Dim strDatapath As String
Dim strSourceFile As String
Dim stAppName As String
Dim Msg, Style, Title, Response
Public Function EmailDATA()
On Error GoTo KRAJ
strDatapath = fCurrentDBDir & "DATA\" 'Ovde navesti dodatak putanje po potrebi
strSourceFile = "Data.mdb" 'Naznačiti tačan naziv fajla
Set fsObject = CreateObject("Scripting.FileSystemObject")
If fsObject.FileExists(strDatapath & strSourceFile) = True Then
stAppName = "C:\Program Files\Winrar\rar.exe a -m5 -ep [email protected] SUBJECT " _
& """" & strDatapath & """" & strSourceFile 'Zameniti korisnik, domen i SUBJECT po želji
Call Shell(stAppName, vbMinimizedNoFocus)
Else
GoTo KRAJ
End If
Exit Function
KRAJ:
MsgBox "Pakovanje i slanje fajla" & strSourceFile & " NIJE uspešno obavljeno!", _
vbExclamation, "Slanje email poruke: GREŠKA!"
End Function
Public Function fCurrentDBDir() As String
'Ispisivanje putanje, naziva... za tekuci fajl
strDBPath = CurrentDb.Name 'pun naziv fajla i njegova putanja
strDBFile = Dir(strDBPath) 'naziv fajla
fCurrentDBDir = Left(strDBPath, InStr(strDBPath, strDBFile) - 1) 'samo putanja
End Function
Slobodno prilagodi ovo za vlastite potrebe...
;)
[Ovu poruku je menjao Catch 22 dana 30.09.2008. u 01:36 GMT+1]
[ domaci_a_nas @ 30.09.2008. 00:56 ] @
Evo primera za program 7 zip, naglašavam da je on BESPLATAN, možeš ga prekopirati u system32, ili u windows folder da bi ga pozivao bez cele putanje. Što se WINRAR tiče, pronađi u helpu za winrar sekciju Command Line Switches, ili na internetu, princip je isti uz male razlike.
Code: Tabele = "E:\BE\Tabele.mdb"
ZipFile = Replace(Tabele, ".mdb", ".zip")
Shell "7za a -y -pTvojaSifra """ & ZipFile & """ """ & Tabele & ""
[ SLOJ.1973 @ 30.09.2008. 17:16 ] @
Hvala Catch22,to je ono što mi je bilo potrebno.Pozdrav svima koji su se potrudili da mi pomognu.
[ Catch 22 @ 30.09.2008. 18:41 ] @
^ Drago mi je da sam ti pomogao, a evo ti još jedna funkcijica koju bi trebalo da pozivaš prilikom samog pokretanja aplikacije, jer između ostalog postavlja folder u kom se nalazi aplikacija za podrazumevani... uz još par dodatnih opcija (koje možeš po potrebi i da isključiš pomoću False / True)
Code:
Function SetBypassProperty()
Const DB_Boolean As Long = 1
ChangeProperty "AllowBypassKey", DB_Boolean, False 'zabrana korišćenja "Shift obilaznice"
Application.SetOption "Show Hidden Objects", False 'zabrana prikaza skrivenih objekata
Application.SetOption "Show System Objects", False 'zabrana prikaza skistemskih objekata
Application.SetOption "Default Database Directory", fCurrentDBDir 'postavljanje tekućeg direktorijuma za podrazumevani
End Function
Za ovo gore će ti trebati i sledeća funkcija:
Code: Public Function ChangeProperty(strPropName As String, varPropType As Variant, _
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|