Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 14 of 14 total
Thread Backup Database not working always???
Fri, Oct 1 2010 4:26 PMPermanent Link

gripsware

gripsware datentechnik gmbh

Tim,

I found the problem. I changed my code to call the Execute method from TEDBDatabase, not TEDBSession and all seems to work fine!!!

Michael

"Tim Young [Elevate Software]" wrote:

I mean this property:

http://www.elevatesoft.com/manual?action=viewprop&id=edb2&product=d&version=7&comp=TEDBEngine∝=LogCategories

--
Tim Young
Elevate Software
www.elevatesoft.com


Sun, Oct 3 2010 1:16 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< I found the problem. I changed my code to call the Execute method from
TEDBDatabase, not TEDBSession and all seems to work fine!!! >>

The TEDBSession.Execute looks like this:

function TEDBSession.Execute(const SQL: TEDBString; Params: TParams=nil;
                            Query: TEDBQuery=nil): Integer;
var
  TempQuery: Boolean;
begin
  Open;
  TempQuery:=(not Assigned(Query));
  if TempQuery then
     Query:=TEDBQuery.Create(nil);
  try
     Query.Active:=False;
     Query.SessionName:=FSessionName;
     Query.DatabaseName:=CONFIG_DATABASE_NAME;
     Query.SQL.Text:=SQL;
     Query.RequestSensitive:=True;
     if (Params <> nil) then
        Query.Params.Assign(Params);
     if TempQuery then
        begin
        Query.OnProgress:=FOnProgress;
        Query.OnStatusMessage:=FOnStatusMessage;
        Query.OnLogMessage:=FOnLogMessage;
        end;
     Query.ExecSQL;
     Result:=Query.RowsAffected;
  finally
     if TempQuery then
        FreeAndNil(Query);
  end;
end;

and the TEDBDatabase.Execute method looks like this:

function TEDBDatabase.Execute(const SQL: TEDBString; Params: TParams=nil;
                             Query: TEDBQuery=nil): Integer;
var
  TempQuery: Boolean;
begin
  Open;
  TempQuery:=(not Assigned(Query));
  if TempQuery then
     Query:=TEDBQuery.Create(nil);
  try
     Query.Active:=False;
     Query.SessionName:=FSessionName;
     Query.DatabaseName:=FDatabaseName;
     Query.SQL.Text:=SQL;
     Query.RequestSensitive:=True;
     if (Params <> nil) then
        Query.Params.Assign(Params);
     if TempQuery then
        begin
        Query.OnProgress:=FOnProgress;
        Query.OnStatusMessage:=FOnStatusMessage;
        Query.OnLogMessage:=FOnLogMessage;
        end;
     Query.ExecSQL;
     Result:=Query.RowsAffected;
  finally
     if TempQuery then
        FreeAndNil(Query);
  end;
end;

The only difference is the DatabaseName property assignment.  So, my guess
is that the problem is somewhere else.

Are you defining a database in your application with the DatabaseName
property set to "Configuration", perhaps ?

--
Tim Young
Elevate Software
www.elevatesoft.com
Sun, Oct 3 2010 2:25 PMPermanent Link

gripsware

gripsware datentechnik gmbh

Tim,

yes you are right, that is not the problem, it fails again.

No, my DatabaseName is 'MyAudiopp'. I have no Database, no Table and nothing else with the Name Configuration.

When I run the Database Backup in EDBManager it works every time, but not from my application. Do you think it can help you when I send you an Backup of the Database?

Michael

"Tim Young [Elevate Software]" wrote:

Michael,

<< I found the problem. I changed my code to call the Execute method from
TEDBDatabase, not TEDBSession and all seems to work fine!!! >>

The TEDBSession.Execute looks like this:

function TEDBSession.Execute(const SQL: TEDBString; Params: TParams=nil;
                            Query: TEDBQuery=nil): Integer;
var
  TempQuery: Boolean;
begin
  Open;
  TempQuery:=(not Assigned(Query));
  if TempQuery then
     Query:=TEDBQuery.Create(nil);
  try
     Query.Active:=False;
     Query.SessionName:=FSessionName;
     Query.DatabaseName:=CONFIG_DATABASE_NAME;
     Query.SQL.Text:=SQL;
     Query.RequestSensitive:=True;
     if (Params <> nil) then
        Query.Params.Assign(Params);
     if TempQuery then
        begin
        Query.OnProgress:=FOnProgress;
        Query.OnStatusMessage:=FOnStatusMessage;
        Query.OnLogMessage:=FOnLogMessage;
        end;
     Query.ExecSQL;
     Result:=Query.RowsAffected;
  finally
     if TempQuery then
        FreeAndNil(Query);
  end;
end;

and the TEDBDatabase.Execute method looks like this:

function TEDBDatabase.Execute(const SQL: TEDBString; Params: TParams=nil;
                             Query: TEDBQuery=nil): Integer;
var
  TempQuery: Boolean;
begin
  Open;
  TempQuery:=(not Assigned(Query));
  if TempQuery then
     Query:=TEDBQuery.Create(nil);
  try
     Query.Active:=False;
     Query.SessionName:=FSessionName;
     Query.DatabaseName:=FDatabaseName;
     Query.SQL.Text:=SQL;
     Query.RequestSensitive:=True;
     if (Params <> nil) then
        Query.Params.Assign(Params);
     if TempQuery then
        begin
        Query.OnProgress:=FOnProgress;
        Query.OnStatusMessage:=FOnStatusMessage;
        Query.OnLogMessage:=FOnLogMessage;
        end;
     Query.ExecSQL;
     Result:=Query.RowsAffected;
  finally
     if TempQuery then
        FreeAndNil(Query);
  end;
end;

The only difference is the DatabaseName property assignment.  So, my guess
is that the problem is somewhere else.

Are you defining a database in your application with the DatabaseName
property set to "Configuration", perhaps ?

--
Tim Young
Elevate Software
www.elevatesoft.com
Sun, Oct 3 2010 9:27 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< When I run the Database Backup in EDBManager it works every time, but not
from my application. Do you think it can help you when I send you an Backup
of the Database? >>

Hmmm, it probably won't help if you can't get the backup to fail in the EDB
Manager.  If the EDB log doesn't indicate that the backup failed or ran at
all, then the issue is somewhere with the code, not the database itself.

Did you try pulling out the relevant code into a sample project to see if
you could get it to fail in an isolated environment ?

--
Tim Young
Elevate Software
www.elevatesoft.com
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image