PDA

View Full Version : back up گرفتن از دیتا بیس



yavari
یک شنبه 14 اسفند 1384, 09:22 صبح
با سلام

چه جوری می شه تو برنامه امکان back up گیری را گذاشت .

با تشکر

S_VB.max
یک شنبه 14 اسفند 1384, 11:07 صبح
اول از پنجره Reference گزینه Microsoft Scripting Runtime را اضافه کن



On Error GoTo errdes
Dim chk As String
CommonDialog1.CancelError = True
Dim FSys As New FileSystemObject
Dim thisFile As File
Dim fld As Folder
Set thisFile = FSys.GetFile(App.Path & "\2003.mdb")

CommonDialog1.Filter = "date|*.mdb"
CommonDialog1.filename = "2003"
CommonDialog1.DialogTitle = "Data backup"
CommonDialog1.ShowSave

Dim d As Integer
Dim ln As Integer
Dim SD As String
Dim filenm As String

d = InStrRev(CommonDialog1.filename, "\")
SD = Mid(CommonDialog1.filename, 1, d)
Set fld = FSys.CreateFolder(SD & "Backup")
ln = Len(CommonDialog1.filename)
chk = ln - d
filenm = Right(CommonDialog1.filename, chk)
thisFile.Copy fld.Path & "\" & filenm

Exit Sub
errdes:
If Err.Number = 32755 Then
Exit Sub
Else
MsgBox Err.Description, vbInformation, "Error"
End If

meh_secure
یک شنبه 14 اسفند 1384, 17:10 عصر
تاپیک تکراری ممنوع.