Click here to Skip to main content
15,887,135 members
Home / Discussions / Database
   

Database

 
GeneralRe: Finding lowest integer in an Access Database Pin
Edbert P12-Dec-04 13:24
Edbert P12-Dec-04 13:24 
GeneralUrgent ! Doubt in Sql Pin
goldsuji11-Dec-04 0:54
goldsuji11-Dec-04 0:54 
GeneralRe: Urgent ! Doubt in Sql Pin
venadder11-Dec-04 8:42
venadder11-Dec-04 8:42 
GeneralRe: Urgent ! Doubt in Sql Pin
goldsuji12-Dec-04 19:48
goldsuji12-Dec-04 19:48 
GeneralRe: Urgent ! Doubt in Sql Pin
Mekong River11-Dec-04 17:04
Mekong River11-Dec-04 17:04 
Generalbackup fails!!Urgent Pin
venadder10-Dec-04 13:03
venadder10-Dec-04 13:03 
GeneralRe: backup fails!!Urgent Pin
venadder11-Dec-04 7:04
venadder11-Dec-04 7:04 
GeneralUsing Instances of CRecordset Pin
Chris Meech10-Dec-04 8:20
Chris Meech10-Dec-04 8:20 
I'm missing something and would appreciate a pointer to what might be wrong. The following code
CString  strSQLSelectID = "SELECT PARAM_COUNT, SELECT_STRING FROM P2P.SELECT_SOURCE_COMPLETE";
CString  strParamCount;
CString  strSelectString;
CRecordset* pSet  = new CRecordset(m_DB);

if ( pSet->Open(CRecordset::forwardOnly, strSQLSelectID, CRecordset::readOnly) )
{
  pSet->GetFieldValue("PARAM_COUNT", strParamCount);
  pSet->GetFieldValue("SELECT_STRING", strSelectString);
}
results in an exception being thrown in the first call to GetFieldValue(). The details of the error are
Error: GetFieldValue operation failed on field 0.
Invalid cursor state
State:24000,Native:0,Origin:[Microsoft][ODBC Driver Manager]

Thinking that the cursor is not being setup correctly I tried more 'ordinary' values on the open statement, like the following
if ( pSet->Open(AFX_DB_USE_DEFAULT_TYPE, strSQLSelectID) )

but this results in the Open call throwing an exception with it's details being
No columns were bound prior to calling SQLFetchScroll/SQLExtendedFetch
State:SL009,Native:0,Origin:[Microsoft][ODBC Cursor Library]

The SQL should return 1 row and when I step through the Open call, I can see that the instance of pSet does allocate memory for two field definitions that corresponds to the two columns being queried. I'm missing something basic, I hope, but not sure what. 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]
GeneralSpecified cast is not valid Pin
Anonymous10-Dec-04 7:44
Anonymous10-Dec-04 7:44 
GeneralRe: Specified cast is not valid Pin
tojamismis10-Dec-04 12:36
tojamismis10-Dec-04 12:36 
GeneralCannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
jomargon10-Dec-04 5:25
jomargon10-Dec-04 5:25 
GeneralRe: Cannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
Colin Angus Mackay10-Dec-04 5:44
Colin Angus Mackay10-Dec-04 5:44 
GeneralRe: Cannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
jomargon10-Dec-04 13:56
jomargon10-Dec-04 13:56 
GeneralRe: Cannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
jomargon10-Dec-04 5:58
jomargon10-Dec-04 5:58 
GeneralRe: Cannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
Colin Angus Mackay10-Dec-04 6:05
Colin Angus Mackay10-Dec-04 6:05 
GeneralRe: Cannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
jomargon10-Dec-04 14:02
jomargon10-Dec-04 14:02 
GeneralRe: Cannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
jomargon10-Dec-04 14:03
jomargon10-Dec-04 14:03 
GeneralCalling sp_helptext from ASPNET Pin
Hans Ruck10-Dec-04 5:02
Hans Ruck10-Dec-04 5:02 
GeneralRe: Calling sp_helptext from ASPNET Pin
Colin Angus Mackay10-Dec-04 5:36
Colin Angus Mackay10-Dec-04 5:36 
GeneralRe: Calling sp_helptext from ASPNET Pin
Hans Ruck10-Dec-04 6:18
Hans Ruck10-Dec-04 6:18 
GeneralRe: Calling sp_helptext from ASPNET Pin
tojamismis10-Dec-04 11:28
tojamismis10-Dec-04 11:28 
GeneralRe: Calling sp_helptext from ASPNET Pin
Edbert P12-Dec-04 13:34
Edbert P12-Dec-04 13:34 
GeneralGenerate generalized insert, delete and update statements Pin
CNU9-Dec-04 16:10
CNU9-Dec-04 16:10 
GeneralRe: Generate generalized insert, delete and update statements Pin
Colin Angus Mackay10-Dec-04 5:59
Colin Angus Mackay10-Dec-04 5:59 
QuestionServer -- keep connection open? Or open/close as needed? Pin
Judah Gabriel Himango9-Dec-04 6:32
sponsorJudah Gabriel Himango9-Dec-04 6:32 

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.