Re: Timeout on recordset retrieval/Opening recordset passing comma
From: Nikki Locke (NikkiLocke_at_discussions.microsoft.com)
Date: 07/16/04
- Next message: Julio: "Re: Fields that match condition"
- Previous message: Nikki Locke: "Re: Timeout on recordset retrieval/Opening recordset passing comma"
- In reply to: Val Mazur: "Re: Timeout on recordset retrieval/Opening recordset passing command C"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Jul 2004 01:37:01 -0700
I am using version 2.71.9030.4.
I wish I did have a version with the bug - my problem is that the query times out when I don't want it to.
However the article hints that there is a dynamic property of a recordset to set the timeout, so maybe I should try setting that to zero, or a very large value.
-- Nikki Locke (http://www.trumphurst.com/) "Val Mazur" wrote: > Hi, > > Which version of MDAC are you using? It was a bug related to it, but it was > fixed in MDAC 2.6. > If this is not the case, then there is another bug, which was not fixed and > it is described in next KB > > http://support.microsoft.com/default.aspx?scid=kb;en-us;188858&Product=ado > > -- > Val Mazur > Microsoft MVP > > > "Nikki Locke" <NikkiLocke@discussions.microsoft.com> wrote in message > news:3602EA20-6C97-4839-93F3-EB8C493E3DA1@microsoft.com... > >I have a need to open a recordset without a timeout (my current queries, > > despite being adAsyncFetchNonBlocking and running in a separate thread, > > are > > timing out due to the default timeout). > > > > The only way I have found so far to do this is to set up a Command object, > > and pass it to the recordset open method. > > > > I have some test code in VB, which works fine... > > > > Set oConn = New ADODB.Connection > > oConn.Open "<connection string here>" > > Set oCmd = New ADODB.Command > > Set oRS = New ADODB.Recordset > > oCmd.ActiveConnection = oConn > > oCmd.CommandTimeout = 0 > > oCmd.CommandText = "Select * from [Part Master]" > > oCmd.CommandType = adCmdText > > oRS.CursorLocation = adUseClient > > oRS.Open oCmd, , adOpenKeyset, adLockUnspecified, adAsyncFetchNonBlocking > > > > But trying to implement the same thing in C++ gives an error "Arguments > > are > > of the wrong type, are out of acceptable range, or are in conflict with > > one > > another." > > > > Here is my code - what is wrong with it? > > > > pCommand->put_ActiveConnection( > > _variant_t((IDispatch *)m_pConnection,true)); > > pCommand->PutCommandTimeout(0); > > pCommand->CommandText = _bstr_t(pRecOpenInfo->m_sQuery); > > pCommand->CommandType = ADODB::adCmdText; > > pRstRecOpen->put_CursorLocation(ADODB::adUseClient); > > > > _variant_t vtempty; > > > > pRstRecOpen->Open( _variant_t((IDispatch *)pCommand, true), > > vtempty, ADODB::adOpenKeyset, ADODB::adLockOptimistic, > > ADODB::adAsyncFetchNonBlocking); > > > > -- > > Nikki Locke (http://www.trumphurst.com/) > > > > >
- Next message: Julio: "Re: Fields that match condition"
- Previous message: Nikki Locke: "Re: Timeout on recordset retrieval/Opening recordset passing comma"
- In reply to: Val Mazur: "Re: Timeout on recordset retrieval/Opening recordset passing command C"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|