?
Solved

Database exclusive???

Posted on 2003-03-26
4
Medium Priority
?
151 Views
Last Modified: 2010-04-04
Here is my code:
         table.EmptyTable;

         while not tableID.Eof do begin
               table.Insert;
               tableNAME.AsString := tableIdBIRTHNAME.AsString;
               tableLAST.AsString := tableIdLAST.AsString;
               table.Post;
               tableId.Next;
         end;

my table called "Table" is set at exclusive = true in the property.
The thing is how do I do that if someone access the database in the sametime as another person that the person who connects to the database doesn't do the code I wrote above???
0
Comment
Question by:forzaMe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8213823
if you set the table exclusive,
then no one else can use the table
after you open it
until you close it

you may not able to set the table exclusive,
if some one already accesses the table

but i understand your question not really,
could you explain?

meikl ;-)
0
 

Author Comment

by:forzaMe
ID: 8219626
What I meant to say is that, I want that when someone opens up the program, the program normally does the code I wrote above, but if someone else has also opened the program in the sametime,I want a popup message saying that it wont do that code, I dont know if you get what I mean.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 8219689
begin
  table.exclusive := true;
  try
    table.Open;
  except
    Showmessage('Sorry, can''t do that yet');
    abort;  //silent exception -> leaves this codeblock
  end;
  table.EmptyTable;
  while not tableID.Eof do
  begin
    table.Insert;
    tableNAME.AsString := tableIdBIRTHNAME.AsString;
    tableLAST.AsString := tableIdLAST.AsString;
    table.Post;
    tableId.Next;
  end;
  table.close;
end;

just as suggestion,
there may also other ways

meikl ;-)

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8220689
go here

http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

read there the paragraph
How Do I Know What Grade to Give?

and explain why you give a c-grade

meikl ;-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question