Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Deleting Memory Table
Tue, Jan 10 2006 12:37 PMPermanent Link

"Jack Marsh"
Hi,

I am using DBISAM with Intraweb to create a memory table using the following
code:

UserSession.DBQ.DatabaseName := 'MyDB';
UserSession.DBQ.SessionName := UserSession.DBS.SessionName;
UserSession.DBQ.Prepare;
UserSession.DBQ.ExecSQL;
UserSession.DBQ.Close;

Where the DBISAMQuery DBQ SQL statement is:

SELECT *
INTO "\Memory\Results"
FROM "Contacts"
WHERE Surname = 'Anderson'

However, when I try to delete the "\Memory\Results" table on the
UserSession's onDestroy event using a DBISAMTable component with the
following code:

if ResultsTbl.Exists then
 ResultsTbl.DeleteTable;

I get a DBISAM 11013 error reported - Access denied to table Results.Dat

How do I release the table and why is it locked?  (I assumed that calling
the DBISAMQuery component's close method would release the table)

Thanks for any help,
Jack

Tue, Jan 10 2006 12:59 PMPermanent Link

Jeff Cook
"Jack Marsh" <jack@marshdata.co.uk> wrote on Tue, 10 Jan 2006 17:28:44 -0000

>Hi,
>
>I am using DBISAM with Intraweb to create a memory table using the following
>code:
>
>UserSession.DBQ.DatabaseName := 'MyDB';
>UserSession.DBQ.SessionName := UserSession.DBS.SessionName;
>UserSession.DBQ.Prepare;
>UserSession.DBQ.ExecSQL;
>UserSession.DBQ.Close;
>
>Where the DBISAMQuery DBQ SQL statement is:
>
>SELECT *
>INTO "\Memory\Results"
>FROM "Contacts"
>WHERE Surname = 'Anderson'
>
>However, when I try to delete the "\Memory\Results" table on the
>UserSession's onDestroy event using a DBISAMTable component with the
>following code:
>
>if ResultsTbl.Exists then
> ResultsTbl.DeleteTable;
>
>I get a DBISAM 11013 error reported - Access denied to table Results.Dat
>
>How do I release the table and why is it locked? (I assumed that calling
>the DBISAMQuery component's close method would release the table)
>
>Thanks for any help,
>Jack
>
>
Jack


Have you closed the query UserSession.DBQ and table ResultsTbl?  And if you manually prepared the query, you'll need to unprepare it.

HTH

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



Tue, Jan 10 2006 7:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jack,

<< I get a DBISAM 11013 error reported - Access denied to table Results.Dat

How do I release the table and why is it locked?  (I assumed that calling
the DBISAMQuery component's close method would release the table) >>

Jeff is correct - you must make sure that if you manually prepared the query
using the Prepare method, you need to manually call the UnPrepare method to
release the resultant table.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image