[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

TSQLClientDataSet Eof

Posted on 2006-07-13
8
Medium Priority
?
257 Views
Last Modified: 2010-04-05
After I do TSQLClientDataSet.SaveToFile, Eof is true after LoadFromFile even the XML file have data content inside.

What seems to be the problem ?

Andrew
0
Comment
Question by:andrewyu
[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
  • 4
  • 2
8 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 100 total points
ID: 17101618

Andrew,
I am guessing that the SaveToFile method walks the records during the save, leaving the current row pointer at the end. Sounds like you should issue a call to the DataSet First method in order to reset the cursor location.

Regards,
Russell
0
 

Author Comment

by:andrewyu
ID: 17105070
What do you meant by that ?
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 17105206
?? I am assuming you have some experience with datasets...

If the dataset is at EOF, then the dataset's cursor (current record) is located AFTER the last record in the dataset. The cause of this is most likely the SaveToFile performing something like:

DataSet.First;
while not(DataSet.Eof) do
begin
  ... export the record
  Dataset.Next;
end;

At the end of this, the DataSet's cursor is at the EOF marker. Meaning, you need to call TSQLClientDataSet.First in order to reset the cursor to the first record again.



Russell
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:andrewyu
ID: 17105278
So, you suggest to call DataSet.First; before import and and export first. am i correct ?
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 17105395

Yes on the after part...
As to the before part, I would imagine that the person (who wrote the export routine) already considered this and is doing it already. The easiest way to tell is to call the DataSet's .Last method, run the SaveToFile, and confirm that all the data is written out.

Russell
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 17105477

Btw, I didnt mean to infer that calling .First both before AND after would cause any problem. While it may be unnecessary calling it before the export, it should not hurt anything either.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 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