Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Dynamically created table does not exist ... but it does!
Mon, Sep 4 2006 11:54 PMPermanent Link

Jeff Cook
Hi


With the following code:-
var
 tbl: TDBISAMTable;
begin
 tbl := TDBISAMTable.Create(Self);
 try
   tbl.SessionName := 'Session';
   tbl.TableName := sTableName;
   tbl.GetFieldNames(sl);   <<<<< error here <<<<

... I get this error:-.

exception class   : EDBISAMEngineError
exception message : DBISAM Engine Error # 11010 Table or backup file 'Landlords' does not exist.

DBISAM 4.24 Build 1
I
am already connected to the database using a TDBISAMSession called "Session" and a table of that name definitely exists.  I tried setting the tbl.DtabaseName, but it complained that it was ReadOnly.  I realise now that this is probably the first time that I have created a table dynamically - I usually have a table component on the form or datamodule and set the properties in the Object Inspector - so I'm not surprised that I've come unstuck.
What now?

Cheers

Jeff

P.S.  I had perfectly good code working that opened a query on the table and iterated through the fieldnames - but in these newsgroups I read about a GetFieldNames and that the table need not be open and thought that I would use it!
--
Jeff Cook
Aspect Systems Ltd
Phone: +64-9-424 5388
Skype: jeffcooknz
www.aspect.co.nz



Tue, Sep 5 2006 1:27 AMPermanent Link

"Terry Swiers"
Jeff,

> am already connected to the database using a TDBISAMSession called
> "Session" and a table of that name definitely exists. I tried setting the
> tbl.DtabaseName, but it complained that it was ReadOnly.

It sounds like you tried to set tbl.Database rather than tbl.DatabaseName
since the Database property is read-only.  Without setting both the
SessionName and DatabaseName properties it's not going to be able to find
the table and you will get 11010 error.

--

---------------------------------------
 Terry Swiers
 Millennium Software, LLC
 http://www.1000years.com
 http://www.atrex.com

 Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

Atrex Electronic Support Options:
 Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
 Email: mailto:support@atrex.com
 Newsgroup: news://news.1000years.com/millennium.atrex
 Fax: 1-925-829-1851
 Phone: 1-925-828-5892 (M-F, 9a-5p Pacific)
 ---------------------------------------

Tue, Sep 5 2006 5:11 PMPermanent Link

Jeff Cook
"Terry Swiers" <millennnium@1000years.com> wrote on Mon, 4 Sep 2006 22:23:43 -0700

>Jeff,
>>
>It sounds like you tried to set tbl.Database rather than tbl.DatabaseName
>since the Database property is read-only. Without setting both the
>SessionName and DatabaseName properties it's not going to be able to find
>the table and you will get 11010 error.
>
Terry

Thanks for that - it was exactly what I was doing wrong.

Cheers


Jeff
--
Jeff Cook
Aspect Systems Ltd
Phone: +64-9-424 5388
Skype: jeffcooknz
www.aspect.co.nz



Image