Subject GDB Backup failure
Author Robert F. Tulloch
Hi:

Trying to back up gdb on server (nts) from workstation. "LTDMSA" is a share on the
network.

nts:C:\LTDMS\LTDMSA is the share and nts:C:\LTDMS\LTDMSA\Backup is valid directory.

BackupFilePath: { "\\\\nts\\LTDMSA\\Backup\\LTDMSData1.gbk" } from debug | watch

-------------------------------------------------------------------------------------------

Before doing this in app I tested code below which works fine. Why wouldn't gbak
follow suit?

Thanks.

Best regards

//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
int Success;
char szMessage[100];
String GDBSourceFile = "\\\\nts\\testfilecopy\\Test.txt";
String GDBDestinationFile = "\\\\nts\\testfilecopy\\Test\\Test.txt";

// String GDBSourceFile = "\\\\Ws1\\testfilecopy\\Test.txt";
// String GDBDestinationFile = "\\\\Ws1\\testfilecopy\\Test\\Test.txt";

SHFILEOPSTRUCT FileOp;
char szSource[MAX_PATH] = {0};
char szDestination[MAX_PATH] = {0};
strcpy(szSource, GDBSourceFile.c_str());
strcpy(szDestination, GDBDestinationFile.c_str());

// Success = CopyFileA(szSource, szDestination, false);

FileOp.hwnd = this->Handle;
FileOp.wFunc = FO_COPY;
FileOp.pFrom = szSource;
FileOp.pTo = szDestination;
FileOp.fFlags = FOF_NOCONFIRMATION | FOF_SIMPLEPROGRESS ;
FileOp.fAnyOperationsAborted = FALSE;
FileOp.hNameMappings = NULL;
String Title = "Testing Copy";
FileOp.lpszProgressTitle = Title.c_str();

//Copy the file
Success = SHFileOperation(&FileOp);
wsprintf(szMessage, "error %d", GetLastError());


if(Success == 0 )
Edit1->Text = "Success";
else
ShowMessage(szMessage);