please be aware that you will run into quite some programming effort if you attempt to convert the MFC CRecordSet methods like MovePrev(), into an sqlite equivalent. In MFC they often use statements like
myTable.Open(); while( !myTable.IsEOF() ) { // do something ... myTable.MoveNext(); } I tend to argue that it is impossible to add a MovePrev(), inside such a loop without the need to restart the hole processing - IF you intend to maintain the MFC style. Some time ago I created CRecordSet wrapper for sqlite while porting an application to use sqlite instead - but I skipped the MovePrev() method - Usually they can be avoided with a little restructuring of the MFC style of coding - you might consider this as well. Anyway, back to your question - It is not clear what you are asking since you already quote the relevant chapters from the sqlite doc. So the answer is yes, the ROWID can be accessed obviously faster compared to a standard column. But I think this is not really your problem here... Marcus On 26.12.2012 17:28, genliu777 wrote:
the reason that i talk about how to get ROWID of record is that i want to access specific record by the FASTEST way! i read the document of sqlite again, and find if i define a field(e.g. social_num) with the feature of "*integer primary key*" , i can access record by the value of the field in the fastest way. is it true!? the orignal descripiton follows, "Searching for a record with a specific rowid, or for all records with rowids within a specified range is around twice as fast as a similar search made by specifying any other PRIMARY KEY or indexed value." "*With one exception*, if a table has a primary key that consists of a single column, and the declared type of that column is "INTEGER" in any mixture of upper and lower case, then the column becomes an alias for the rowid." "Rowid values may be modified using an UPDATE statement in the same way as any other column value can, either using one of the built-in aliases ("rowid", "oid" or "_rowid_") or *by using an alias* created by an integer primary key. " -- View this message in context: http://sqlite.1065341.n5.nabble.com/how-to-move-around-records-in-sqlite-as-the-way-as-in-CDaoRecordset-of-MFC-tp66191p66276.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
-- Marcus Grimm MedCom GmbH Darmstadt, Rundeturmstr. 12, 64283 Darmstadt Tel: +49(0)6151-95147-10 Fax: +49(0)6151-95147-20 web: www.medcom-online.de -------------------------------------------------- MedCom slogans of the month: "Vacation ? -- Every day at MedCom is a paid vacation!" "Friday I have monday in my mind." "MedCom -- Every week a vacation, every day an event, every hour a cliffhanger, every minute a climax." "Damned, it's weekend again!" _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users