Click here to Skip to main content
15,892,005 members
Home / Discussions / Database
   

Database

 
GeneralRe: Help for a beginner Pin
Mike Dimmick22-May-08 3:12
Mike Dimmick22-May-08 3:12 
QuestionDelete and Truncate Pin
.NET- India 21-May-08 6:45
.NET- India 21-May-08 6:45 
AnswerRe: Delete and Truncate Pin
SomeGuyThatIsMe21-May-08 7:03
SomeGuyThatIsMe21-May-08 7:03 
AnswerRe: Delete and Truncate Pin
Michael Potter21-May-08 10:38
Michael Potter21-May-08 10:38 
AnswerRe: Delete and Truncate Pin
Mycroft Holmes21-May-08 17:54
professionalMycroft Holmes21-May-08 17:54 
AnswerRe: Delete and Truncate Pin
Ashfield21-May-08 21:16
Ashfield21-May-08 21:16 
QuestionDatabase Upsizing from MSDB to SQL Pin
new2pgrmg21-May-08 5:26
new2pgrmg21-May-08 5:26 
QuestionSOLVED SQL error - attempted to position cursor on empty recordset. Using "LIKE" [modified] Pin
Vaclav_21-May-08 4:54
Vaclav_21-May-08 4:54 
The following code is giving me the described error. I have included my debug trace also.

Apparently if the "LIKE" text is not found at all is causing this behavior.

How do I get around it?

Thanks for your help.
Vaclav

m_FDRecordset->Open(AFX_DB_USE_DEFAULT_TYPE,
"SELECT * FROM [Log] WHERE [Callsign] LIKE '" + text + "%'",
CRecordset::readOnly );

CString strSQL = m_FDRecordset->GetSQL( );
TRACE("\n SQL %s ",strSQL);


Debug trace

SQL SELECT * FROM `Log` WHERE `Callsign` LIKE 'AA1A%' Error: attempted to position cursor on empty recordset.
Attempt to scroll past end or before beginning of data.
First-chance exception in FD2008.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.



ALWAYS CHECK RETRUN FROM FUNCTION

if(!m_FDRecordset->Open(AFX_DB_USE_DEFAULT_TYPE,
"SELECT * FROM [Log] WHERE [Callsign] LIKE '%" + text + "%' ",
CRecordset::readOnly ))
{
// ... handle error here
};

ALWAYS CHECK FOR EOF

if(m_FDRecordset->IsEOF())
{
// NO DATA FOUND
};

<div class="ForumMod">modified on Wednesday, May 21, 2008 12:27 PM</div>
AnswerRe: SQL error - attempted to position cursor on empty recordset. Using "LIKE" Pin
Mike Dimmick21-May-08 6:08
Mike Dimmick21-May-08 6:08 
GeneralRe: SQL error - attempted to position cursor on empty recordset. Using "LIKE" Pin
Vaclav_21-May-08 6:27
Vaclav_21-May-08 6:27 
QuestionTop 5 Records Pin
.NET- India 21-May-08 4:33
.NET- India 21-May-08 4:33 
AnswerRe: Top 5 Records Pin
Ashfield21-May-08 4:41
Ashfield21-May-08 4:41 
QuestionRow Terminator not working: Pin
Shahzad.Aslam21-May-08 3:06
Shahzad.Aslam21-May-08 3:06 
AnswerRe: Row Terminator not working: Pin
Ashfield21-May-08 4:36
Ashfield21-May-08 4:36 
GeneralRe: Row Terminator not working: Pin
Shahzad.Aslam21-May-08 4:40
Shahzad.Aslam21-May-08 4:40 
GeneralRe: Row Terminator not working: Pin
Ashfield21-May-08 21:19
Ashfield21-May-08 21:19 
GeneralRe: Row Terminator not working: Pin
Shahzad.Aslam21-May-08 21:41
Shahzad.Aslam21-May-08 21:41 
GeneralRe: Row Terminator not working: Pin
Ashfield21-May-08 22:28
Ashfield21-May-08 22:28 
QuestionSql Stored Procedure Pin
senthilsstil20-May-08 23:58
senthilsstil20-May-08 23:58 
Questionhow to retrive the value of the sp output through execute immediate Pin
lakshmichawala20-May-08 23:08
lakshmichawala20-May-08 23:08 
Questionsql query Pin
Unknown Ajanabi20-May-08 23:02
Unknown Ajanabi20-May-08 23:02 
AnswerRe: sql query Pin
Colin Angus Mackay21-May-08 1:01
Colin Angus Mackay21-May-08 1:01 
AnswerRe: sql query Pin
Michael Potter21-May-08 10:23
Michael Potter21-May-08 10:23 
Questionproblem with SQLparameter? Pin
Mr.Kode20-May-08 22:20
Mr.Kode20-May-08 22:20 
AnswerRe: problem with SQLparameter? Pin
Unknown Ajanabi20-May-08 23:17
Unknown Ajanabi20-May-08 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.