Solved

TQuery.RecNo have -1 value?

Posted on 1998-04-15
2
690 Views
Last Modified: 2008-02-01
TQuery.RecNo have -1 value?
I want the same selected record
after the refresh like the dbase program
&&&&&&
recno = recno()
close
select 1
use data
go recno
&&&&&&&&&&
but the BCB program
recno = myQuery->RecNo;
myQuery->Close();
// do something
myQuery->Open();
myQuery->MoveBy(recno);
//////////////
Check the value of recno is -1.
Why? Can you tell me? Thank you!
0
Comment
Question by:mathematics
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
julio011597 earned 100 total points
Comment Utility
Is this a query on an SQL database?

If so, here is the answer (cut-and-past'ed from the Help file):

"The RecNo property returns a record number for the current record in the dataset. Record numbers are only available for Paradox and dBASE tables; the concept isn't supported by most SQL servers so a table in a SQL database always returns -1 for RecNo."

HTH.
0
 
LVL 5

Expert Comment

by:julio011597
Comment Utility
mathematics, this is not first time i answer a question of yours and get either a low grade or an autograde... but, believe me, this will be last time.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now