Solved

Querying a dataset over a WAN

Posted on 1997-09-10
2
184 Views
Last Modified: 2012-05-04
We are running D1 developer edition with paradox databases. We want to query our paradox (5.0) databases over a WAN pretty speedily (client-server?). Do we need ODBC/SQL links, C?s edition, 32 -bit Delphi? In other wors what are our options for achieving our goal? Thanks. Tom. [BTW, how do I get extra points so I can award this question more?]

After calls to Borland tech support we weren't provided with a satisfactory answer.
0
Comment
Question by:tomcorcoran
[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
2 Comments
 
LVL 1

Accepted Solution

by:
anilms earned 30 total points
ID: 1344604
1. The first thing you have to remember is that Paradox and Foxpro DBFs are not true C/S databases, ie., when you fire a query, the whole file comes to your computer where it is processed. Therefore you will have to simulate a server.

2. While it is very easy to do it using Delphi 3.0 with its support for ActiveX DLLs, the same can still be achieved using D1. We had a similar need as yours using DBF tables where the records used to run to a million sometimes. I will explain below how we managed to get satisfactory improvement in speed.

C - the central server which stores all the DBF files.
U - a user node some 40 kms away - a dial up link.
QDB - a query DBF on C - contains only two fields - QUERY c 150 and RESULT c 1. It is shared and can be accessed from U.
QDBP - a program written in delphi running on C. It has a timer and continously scans QDB for records in which RESULT is blank (which means a new query record has been added). It puts 'P' (Processing) in the RESULT field, picks up the QUERY string, processes it and creates a new DBF called QRESULT. It puts a 'O' in the RESULT field to indicate that the processing is over. The QUERY can be any valid SQL statement allowed for DBF files. QDBP also checks for RESULT = 'D' and deletes these records.

UPD - An user program in Delphi running on U which has to query C and the result could be a combination of two or more DBFs on C. The UDP constructs a query string and adds a QUERY record in QDB on C. Then it starts checking the RESULT for that QUERY in the QDB file itself (using a timer, of course). As soon as the RESULT turns to O, it picks up the QRESULT data and directly displays it in the DBGrid or whatever display component is needed. It also sets RESULT on QDB to 'D' so that the QFBP program can delete this.

UFP - Similar program on user node - running in Foxpro 2.5. Here, as we do not have a timer, we keep looping continously till the RESULT field turns to 'O' in the QDB DBF.

We have found that the following speed increases :
1. Only 1 DBF involved in query : 2-3 times
2. 2 or more DBFs : 7-8 times
The increase in speed is basically because the query is processed on the server and only the result is picked up from the QRESULT DBF.
0
 

Author Comment

by:tomcorcoran
ID: 1344605
Thanks for the response. There has to be a better system here, I would like more comments on this but grading an answer stops that right (the above did not deserve an F)?

So does sql links automate the above? Is it advisable to use them with D1 - tech support said we had to convert to 32 bit Delphi.
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

Suggested Solutions

Title # Comments Views Activity
Reconfigure Delphi Install? 2 78
SUM 2 INTEGER ARRAYS INTO 1 10 118
Tvertscrollbox like a whatsapp layout 5 69
TAction.OnAfterExecute? 2 32
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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