Click here to Skip to main content
15,918,168 members
Home / Discussions / Database
   

Database

 
GeneralRe: Using DATEFIRST in a View - I want the week to start on Monday instead of Sunday. Pin
tojamismis13-Dec-04 6:48
tojamismis13-Dec-04 6:48 
GeneralLines of Invoice Pin
ruifernandes2412-Dec-04 11:13
ruifernandes2412-Dec-04 11:13 
GeneralRe: Lines of Invoice Pin
Edbert P12-Dec-04 13:12
Edbert P12-Dec-04 13:12 
Generalinsert string wiht ' chare Pin
Anonymous12-Dec-04 5:43
Anonymous12-Dec-04 5:43 
GeneralRe: insert string wiht ' chare Pin
DavidNohejl12-Dec-04 7:16
DavidNohejl12-Dec-04 7:16 
GeneralRe: insert string wiht ' chare Pin
Edbert P12-Dec-04 13:14
Edbert P12-Dec-04 13:14 
General.Net/COM+ Pin
Member 131282211-Dec-04 22:31
Member 131282211-Dec-04 22:31 
GeneralUpdating SQL Server 2000 with varying column names Pin
ColdWaterBlue11-Dec-04 16:03
ColdWaterBlue11-Dec-04 16:03 
GeneralRe: Updating SQL Server 2000 with varying column names Pin
Mekong River11-Dec-04 16:53
Mekong River11-Dec-04 16:53 
GeneralRe: Updating SQL Server 2000 with varying column names Pin
ColdWaterBlue11-Dec-04 21:13
ColdWaterBlue11-Dec-04 21:13 
GeneralFinding lowest integer in an Access Database Pin
pjholliday11-Dec-04 11:24
pjholliday11-Dec-04 11:24 
GeneralRe: Finding lowest integer in an Access Database Pin
Mekong River11-Dec-04 16:59
Mekong River11-Dec-04 16:59 
GeneralRe: Finding lowest integer in an Access Database Pin
pjholliday12-Dec-04 2:24
pjholliday12-Dec-04 2:24 
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 

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.