Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread ElevateDB Error #1000 During Update
Tue, Jul 8 2014 10:37 PMPermanent Link

Michael Riley

ZilchWorks

Avatar

I get an Error #1000 trying to update the Databases Table path in the
DataModule OnCreate event. Here is the exact error message:

ElevateDB Error #1000 An error occurred with the cursor Databases
(An attempt was made to update a read-only cursor)

How do I get this UPDATE statement to work?

*DFM*
object ConfigurationQuery: TEDBQuery
   DatabaseName = 'Configuration'
   SessionName = 'CCMath'
   SQL.Strings = (
      '')
   Params = <>
   Left = 360
   Top = 32
end


procedure TdmCCMath.DataModuleCreate(Sender: TObject);
begin
 CCMathEngine.Active := True;
 CCMathSession.Connected := True;

 { TODO : Update configuration databases table set path =
CSIDL_COMMON_APPDATA +'\Data' }
 with ConfigurationQuery do
 begin
   SQL.Text:='UPDATE Databases SET PATH = ''' +
CCMathEngine.ConfigPath + '\Data''';
   ExecSQL;
  end;
end;


--
Michael Riley
GySgt USMC (Ret)
www.zilchworks.com
Wed, Jul 9 2014 4:03 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Michael


Assuming that you haven't deliberately set things up to be read only I'd guess that when you copied the stuff from CD god ol Windows has decided that since a CD is read only it will preserve that property on the copied files.

You'll need to edit the properties in Explorer and set them back to non-read only.

Roy Lambert
Wed, Jul 9 2014 5:21 AMPermanent Link

Michael Riley

ZilchWorks

Avatar

Solved.

I needed to used the ALTER DATABASE command instead.

procedure TdmCCMath.DataModuleCreate(Sender: TObject);
begin
 CCMathEngine.Active := True;
 CCMathSession.Connected := True;

 with ConfigurationQuery do
 begin
   SQL.Text:='ALTER DATABASE "CCMath" PATH ''' +
CCMathEngine.ConfigPath + '\Data''';
   ExecSQL;
  end;
end;

http://www.elevatesoft.com/supportfaq?action=view&category=edb&question=change_database_path
http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=ALTER_DATABASE


--
Michael Riley
GySgt USMC (Ret)
www.zilchworks.com
Wed, Jul 9 2014 5:29 AMPermanent Link

Michael Riley

ZilchWorks

Avatar

Roy Lambert wrote:

> Michael
>
>
> Assuming that you haven't deliberately set things up to be read only I'd guess that when you copied the stuff from CD god ol Windows has decided that since a CD is read only it will preserve that property on the copied files.
>
> You'll need to edit the properties in Explorer and set them back to non-read only.
>
> Roy Lambert

Roy<

I needed to used the ALTER DATABASE command instead.

procedure TdmCCMath.DataModuleCreate(Sender: TObject);
begin
 CCMathEngine.Active := True;
 CCMathSession.Connected := True;

 with ConfigurationQuery do
 begin
   SQL.Text:='ALTER DATABASE "CCMath" PATH ''' + CCMathEngine.ConfigPath + '\Data''';
   ExecSQL;
  end;
end;

http://www.elevatesoft.com/supportfaq?action=view&category=edb&question=change_database_path
http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=ALTER_DATABASE

--
Michael Riley
GySgt USMC (Ret)
www.zilchworks.com
Wed, Jul 9 2014 5:53 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Michael


That advice was based on not reading your post properly Frown

I shall give myself 3 house demerits

Roy Lambert
Image