MadridEspana
MIS
I wrote a program that dettaches our month end database on Friday night and should attach it back again on Saturday morning. The dettaching works just fine but attaching does not work. Any ideas?
Dim oSQLSrv As New SQLDMO.SQLServer
FileName1 = .mdf filename
FileName2 = .ldf filename
oSQLSrv.Connect SQLServerName, SQLUserID, SQLPwd
oSQLSrv.AttachDB sDBName, FileName1 & ", " & FileName2
oSQLSrv.DisConnect
Set oSQLSrv = Nothing
Dim oSQLSrv As New SQLDMO.SQLServer
FileName1 = .mdf filename
FileName2 = .ldf filename
oSQLSrv.Connect SQLServerName, SQLUserID, SQLPwd
oSQLSrv.AttachDB sDBName, FileName1 & ", " & FileName2
oSQLSrv.DisConnect
Set oSQLSrv = Nothing