老接到一下挑戰我熟悉範圍的活兒,不過也好,可以多學習點,但就是樣樣都很菜,整天都成了問問題大王了,PC上的東西做久了回頭再做大機又得天天問人了,我暈啊暈~!!!
呵呵,不過其實還是不難的,用VBS調用ADO通路資料庫做備份,簡單的VBS貼出來.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name DB_Backup.vbs Backup SQL Server DB '
' Author Jessie Zhang '
' Date 20100803 '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Const CustomerBackupPath = "D:/FinIQ_Database_backup/Customer.bak"
Dim ServerName,UserId,UserPwd,DBName
Dim objConnection,strConnectionString,strSQL
ServerName = "ServerName"
DBName = "Customer"
UserId = Wscript.Arguments(0)
UserPwd = Wscript.Arguments(1)
strConnectionString = "Driver={sql server};server=" & ServerName & ";uid=" & UserId & ";pwd=" & UserPwd & ";database=" & DBName
strSQL = "BACKUP DATABASE [Customer] TO DISK = N'" & CustomerBackupPath & "' WITH NOFORMAT, NOINIT, NAME = N'Customer-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10"
Set objConnection=CreateObject("ADODB.Connection")
objConnection.ConnectionString = strConnectionString
objConnection.Open
objConnection.Execute strSQL
objConnection.Close
Set objConnection = Nothing
''''''''''''''''''''''''''''''''End''''''''''''''''''''''''''''''''''''''''''