ODBC errors and Query Defs Re-Post 
Author Message
 ODBC errors and Query Defs Re-Post

Sorry Gang, My reader fudged my last post!!
Please help!
Acording to everything I read this should work for an Oracle Data Source.
Anyone see what I am doing Wrong?

Problem:
The dbQueryDef is marked as Close even after the create statement. I have
tried using no parameters to the "create()" and using a blank string for the
name parameter. The combination I am using now is the only one that dosn't
make a second log on screen pop up.
Is it allowable to have a tabledef and a query def attached to the same db?
The CRecordset->Open() is throughing an ODBC Excertion because the querydef
is not Open.

Code Segment:
bool DBTable::OpenRecordset(CDaoDatabase* db, CString dbSQLStatement)
{
 bool returnVal=false;

 if(!db->IsOpen())
  AfxMessageBox("The data Base is not Open Yet");

 CloseRecordset(true,true,false);
 dbQueryDef = new CDaoQueryDef(db);

 dbQueryDef->Create(); [if I send params, I only have to log in once, but
the QD is not open]

 if(dbSQLStatement!="")
  dbQueryDef->SetSQL(dbSQLStatement);

 PrepareForSQLPassThrough(dbSQLStatement,false);
 dbQueryDef->SetODBCTimeout(DEFAULT_QUERY_DEF_TIME_OUT_SECS);

 if(dbQueryDef->IsOpen())
 {
  currentRecordset= new CDaoRecordset(db);
  currentRecordset->Open(dbQueryDef,dbOpenDynaset,dbConsistent);
  returnVal=true;
 }
 else
 {
  AfxMessageBox("Query Def did not Open for some reason!");
  TRACE("*** ERROR Query Def not Open!!!! ** \n");
  returnVal=false;
 }

 return returnVal;

Quote:
}

bool DBTable::PassSQLToDBEngine(CString conectString, bool returnRecs,
CString SQLString)
{
 bool returnVal=false;

 returnVal=PrepareForSQLPassThrough(conectString,returnRecs);
 if(returnVal)
 {
  dbQueryDef->SetSQL(SQLString);
  returnVal=true;
 }

 return returnVal;

Quote:
}



Sun, 20 Jan 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. REPOST: Re: TSOPER: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: Werewolves are part of a low fjat Chumbawamba diet

2. REPOST: Re: TSOPER: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: Werewolves are part of a low fjat Chumbawamba diet

3. ODBC Error : "Query is too complex"

4. ODBC Error: Operation must use an updatable query.

5. ODBC error: Operation must use an updatable query

6. ODBC Error : "Query is too complex"

7. ODBC Error : "Query is too complex"

8. ODBC Error : "Query is too complex"

9. TSOPER: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: REPOST: Re: Werewolves are part of a low fjat Chumbawamba diet

10. ODBC errors on VC++ startup - ODBC error.jpg (0/1)

11. Repost:HTTP POSt

12. Querying a HTTP post request

 

 
Powered by phpBB® Forum Software