Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread creating new databases
Tue, May 29 2007 11:48 AMPermanent Link

"Harry de Boer"
LS

In my app's mainform I use code (see below) to set the global engine's
configpath and the login for the default session. I place an editbox on the
form and in an event I want to create the new database (with the name of the
value in the editbox) under the app's directory. I want to check if that db
exists with

 if edtDB.Text <> '' then begin
   with EDBquery do begin
     SQL.Text:='SELECT * FROM Cofiguration.Databases WHERE Name = '+
QuotedStr(edtDB.Text);
     Open;

I'm getting a "Database does not exixt" error. Well that is correct of
course, but I just expected the recordcount to be 0 SmileWhat;'s the proper
way of doing this. I read the examples code but I can't figure it out.
Dbisamitis? Who knowsSmile

Regards, Harry

procedure TfrmMain.FormCreate(Sender: TObject);
var
 Session: TEDBSession;
begin
 inherited;
 Session := Engine.FindSession('Default');
 if Assigned(Session) then
 begin
   Session.LoginUser := 'Administrator';
   Session.LoginPassword := 'EDBDefault';
 end;
 with Engine do begin
   ConfigPath:=ExtractFilePath(Application.ExeName);
   TempTablesPath:=GetTempTablesPath;
 end;
end;

Tue, May 29 2007 1:52 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Harry

Bit of experimentation in EDBMan


SELECT * FROM Cofiguration.Databases WHERE Name ='xxx'

works if a database is already selected

SELECT * FROM Databases WHERE Name ='xxx'

works if you're at the session sql so my guess is that you've already set the database at the query component and you need to remove the configuration.

Seems like a buglet to me but there might be a good reason for it.

Roy Lambert
Tue, May 29 2007 3:16 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Harry,

<<  if edtDB.Text <> '' then begin
   with EDBquery do begin
     SQL.Text:='SELECT * FROM Cofiguration.Databases WHERE Name = '+
QuotedStr(edtDB.Text);
     Open; >>

Are you actually using the name "Cofiguration", or is that a typo ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, May 30 2007 4:42 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Isn't it amazing how good humans are at pattern recognition Smiley

Roy Lambert
Wed, May 30 2007 8:18 AMPermanent Link

"Harry de Boer"
Tim,

> Are you actually using the name "Cofiguration", or is that a typo ?
..... shame on me! There's more then the eye meets, but in this case the eye
wasn't enough itself Smile

Regards, Harry


"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> schreef in bericht
news:102022EF-7993-493A-A7D4-88D1D1E1FE5B@news.elevatesoft.com...
> Harry,
>
> <<  if edtDB.Text <> '' then begin
>     with EDBquery do begin
>       SQL.Text:='SELECT * FROM Cofiguration.Databases WHERE Name = '+
> QuotedStr(edtDB.Text);
>       Open; >>
>
> Are you actually using the name "Cofiguration", or is that a typo ?
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>

Wed, May 30 2007 1:09 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Isn't it amazing how good humans are at pattern recognition Smiley>>

Yeah, it's usually me that is posting code that is missing a character or
two. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Image