Click here to Skip to main content
15,895,256 members
Home / Discussions / Database
   

Database

 
GeneralRe: MSDE US Date format problem Pin
Mike Dimmick18-Dec-04 9:04
Mike Dimmick18-Dec-04 9:04 
GeneralRe: MSDE US Date format problem Pin
hugonz18-Dec-04 11:19
hugonz18-Dec-04 11:19 
GeneralRe: MSDE US Date format problem Pin
Jon Hulatt19-Dec-04 22:51
Jon Hulatt19-Dec-04 22:51 
GeneralRe: MSDE US Date format problem Pin
hugonz21-Dec-04 18:36
hugonz21-Dec-04 18:36 
GeneralInstalling Database Pin
abo el ror17-Dec-04 14:29
abo el ror17-Dec-04 14:29 
GeneralRe: Installing Database Pin
Colin Angus Mackay17-Dec-04 15:28
Colin Angus Mackay17-Dec-04 15:28 
GeneralRe: Installing Database Pin
Javier Lozano17-Dec-04 17:58
Javier Lozano17-Dec-04 17:58 
GeneralMore on CRecordset Instances Pin
Chris Meech17-Dec-04 8:22
Chris Meech17-Dec-04 8:22 
Last week I asked for some help here[^] and didn't get a reply. I was at a client site most of the week and today I got back to some more testing and now know more and hopefully am asking the right question. If the SQL query assigned to a recordset instance refers to a table, then everything works, but if the SQL query assigned to the recordset is a view, then it doesn't work. Most baffling and I can't seem to dig up an answer in the help on this.

This works fine
CString  strSQL("SELECT LANG_CODE, LANG_NAME FROM LANGUAGES_TABLE");
CRecordset  rs(&db);  //  db is already opened and functional.
if ( rs.Open(AFX_DB_USE_DEFAULT_TYPE, strSQL) != TRUE )
{
  return false;
}
while ( !rs.EOF() )
{
  CString  strLangCode;
  CString  strLangName;
  rs.GetFieldValue("LANG_CODE", strLangCode);
  rs.GetFieldValue("LANG_NAME", strLangName);
  rs.MoveNext();
}

But when I change the SQL string to what I posted in my original post where the FROM clause refers to a view, then I get an exception thrown in the GetFieldValue call. The error is something about the Cursor State being illegal for fetching data. If anyone can help, I'd really be grateful. Thanks.

Chris Meech

I am Canadian. [heard in a local bar]

Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]

Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
GeneralRe: More on CRecordset Instances Pin
Mike Dimmick17-Dec-04 12:33
Mike Dimmick17-Dec-04 12:33 
GeneralRe: More on CRecordset Instances Pin
Chris Meech21-Dec-04 2:00
Chris Meech21-Dec-04 2:00 
GeneralRe: More on CRecordset Instances Pin
Chris Meech21-Dec-04 4:32
Chris Meech21-Dec-04 4:32 
GeneralRe: Category Pin
Brendan Vogt17-Dec-04 2:45
Brendan Vogt17-Dec-04 2:45 
GeneralCategory Pin
Brendan Vogt17-Dec-04 0:13
Brendan Vogt17-Dec-04 0:13 
GeneralRe: Category Pin
Colin Angus Mackay17-Dec-04 2:13
Colin Angus Mackay17-Dec-04 2:13 
QuestionUNC required ??? Pin
Vector716-Dec-04 23:39
Vector716-Dec-04 23:39 
AnswerRe: UNC required ??? Pin
Colin Angus Mackay17-Dec-04 2:15
Colin Angus Mackay17-Dec-04 2:15 
AnswerRe: UNC required ??? Pin
Jon Hulatt17-Dec-04 3:50
Jon Hulatt17-Dec-04 3:50 
GeneralRe: UNC required ??? Pin
Colin Angus Mackay17-Dec-04 4:11
Colin Angus Mackay17-Dec-04 4:11 
GeneralMSDE Inquiry Pin
Member 150205616-Dec-04 21:49
Member 150205616-Dec-04 21:49 
GeneralRe: MSDE Inquiry Pin
Colin Angus Mackay17-Dec-04 2:20
Colin Angus Mackay17-Dec-04 2:20 
GeneralRe: MSDE Inquiry Pin
Member 150205617-Dec-04 13:29
Member 150205617-Dec-04 13:29 
GeneralRe: MSDE Inquiry Pin
Colin Angus Mackay17-Dec-04 13:32
Colin Angus Mackay17-Dec-04 13:32 
GeneralRe: MSDE Inquiry Pin
Rob Graham24-Dec-04 6:08
Rob Graham24-Dec-04 6:08 
GeneralListView Control Pin
RogerDodge16-Dec-04 21:41
RogerDodge16-Dec-04 21:41 
GeneralSQL Syntax Error Pin
Suresh Prasad16-Dec-04 19:48
Suresh Prasad16-Dec-04 19:48 

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.