<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Sprechblasentext Zchn";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-US;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.SprechblasentextZchn
{mso-style-name:"Sprechblasentext Zchn";
mso-style-priority:99;
mso-style-link:Sprechblasentext;
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-CH link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Does not work! Here my code:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Call DBOpen(DBName)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Call myDB.SqlExecute("CLONE DATABASE TO '" + StrExch(DBFolder + DBName + "_BAK", "\", "\\") + "'")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Call DBClose<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Call DBKillConnections(DBName)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Call DBUnRegisterServer(DBName)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>DelFiles DBFolder + DBName + ".VDB" 'Files are still open and cannot be deleted!<o:p></o:p></span></p><p class=MsoNormal>DelFiles DBFolder + DBName + ".BLB"<o:p></o:p></p><p class=MsoNormal>DelFiles DBFolder + DBName + ".DAT"<o:p></o:p></p><p class=MsoNormal><span lang=EN-US>DelFiles DBFolder + DBName + ".IND"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>'-----------------------------------------------------------------<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Private Sub DBKillConnections(Optional ByVal DBName As String = "")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Dim myServer As VServer<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Dim Connection As VConnection<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Set Connection = New VConnection<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Set myServer = New VServer<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Connection.Init GetMachineName(), "sa", "sa", Port, , CONNECTIONINITID<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Connection.Open<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> myServer.Init Connection<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> If DBName = "" Then DBName = DBFILENAMERAW<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Call Connection.SqlExecute("DROP CONNECTIONS OF DATABASE " + DBName)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> Connection.Close<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Set Connection = Nothing<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Set myServer = Nothing<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>End Sub<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>'-----------------------------------------------------------------<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Private Sub DBUnRegisterServer(Optional ByVal DBName As String = "")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Dim myServer As VServer<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Dim Connection As VConnection<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Set Connection = New VConnection<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Set myServer = New VServer<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Call myValentina.InitClient(10& * 1024& * 1024&)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> myValentina.DebugLevel = kLogNothing<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Connection.Init GetMachineName(), "sa", "sa", Port, , CONNECTIONINITID<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Connection.Open<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> myServer.Init Connection<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> If DBName = "" Then DBName = DBFILENAMERAW<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Call myServer.UnregisterDatabase(DBName)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Connection.Close<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Set Connection = Nothing<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Set myServer = Nothing<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>End Sub<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:DE-CH'>Anything wrong with this?<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:DE-CH'>Thanks and regards<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:DE-CH'>Fabian<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:DE-CH'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>