Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy Folder
Message
From
24/02/2017 01:24:09
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Copy Folder
Miscellaneous
Thread ID:
01648453
Message ID:
01648453
Views:
53
Sir I am trying to get automatic backup of my sqlserver database folder

I have these codes on timer
If (Time()=[11:04:00])
	dirtarget=Alltrim("Z:\Backup\")+Alltrim(Dtos(Date()))
	If  Not Directory(dirtarget)
		Md 	(dirtarget)
	Endif
	dirsource='D:\ATSQL_17\TABLES'
	Thisform.copyfolder(dirsource,dirtarget)
Endif
and copyfolder function has these codes
<vfp>
**FUNCTION CopyFolder as Boolean
LPARAMETERS vSrcDir as String, vTgtDir as String
 LOCAL oFSO as Object, llOverwrite as Boolean, llReturn as Boolean
 llReturn = .F.
 * // Check source directory
 IF DIRECTORY(m.vSrcDir)
  * // check target drive
  IF DIRECTORY(JUSTDRIVE(m.vTgtDir))
   m.vSrcDir = JUSTPATH(ADDBS(m.vSrcDir))
   m.vTgtDir = JUSTPATH(ADDBS(m.vTgtDir))
   llOverWrite = .T.
   oFSO  = CREATEOBJECT([Scripting.FileSystemObject])
   oFSO.CopyFolder(m.vSrcDir, m.vTgtDir, llOverwrite)
  ENDIF
 ENDIF
 oFSO = []
 RELEASE oFSO
 IF DIRECTORY(m.vTgtDir)
  llReturn = .T.
 ENDIF
 RETURN llReturn
**ENDFUNC
SQLSERVER Management studio is closed but users are working on client pcs'.

When I run my above code then it displays error message shown in attachment.


The reason of error is database is in use.

When software is not running of client pcs' then the above codes work fine.

How to get rid of above error message?
or is there anyway to get sqlserver backup when it is in use.

Please help.
Next
Reply
Map
View

Click here to load this message in the networking platform