RE: Strange behavior from ADODB and SQL Server
From: mklapp (mklapp_at_discussions.microsoft.com)
Date: 08/25/04
- Next message: Eric: "RE: Query tables across multiple databases with sql"
- Previous message: mklapp: "Strange behavior from ADODB and SQL Server"
- In reply to: mklapp: "Strange behavior from ADODB and SQL Server"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Aug 2004 08:43:01 -0700
I have located what seems to be the cause of the problem. I have been using
a single connection to open all recordsets. KB article 235282 suggests
stting cursor location to the client to avoid a problem when opening more
than one recordset on the same connection.
My error has gone but the confusion has not.
The inescapable fact is that the same code ran against the same data,
succeeding once and failing all the rest. Actually, while the program failed
many times before it succeeded, this problem never showed up until the
finished program was demonstrated in a fresh session of the IDE (VS.NET).
I suspect some 'residue' from repeated tests and changes allowed the
statement to succeed until a 'new' IDE 'session' was used.
"mklapp" wrote:
> Hello,
>
> This is a difficult question to ask because most of the circumstances are
> not internally consistent.
>
> This function (not a canonical function, just a collection of subs that
> perform a job) Connects to SQL Server 2000 through an ADODB dataset (MDAC
> 2.8).
>
> All ran well. In order to improve performance and remove connection
> timeouts, I have all my opens use the same ADO connection.
>
> Now one open consistently returnrs either a 'Connection failure' or 'Thread
> has been stopped'.
>
> The statement:
>
> sql = "SELECT AdditionalContacts.ContactDate, '53' AS visitcode, "
> sql = sql & "'" & "BOTH" & "'" & " AS session,
> AdditionalContacts.DateStamp, "
> sql = sql & " AdditionalContacts.StudentID,
> StudentVisits.StudentVisitsId "
> sql = sql & " FROM (AdditionalContacts LEFT JOIN TransData ON
> (AdditionalContacts.ContactDate = "
> sql = sql & " TransData.VisitDate) AND
> (AdditionalContacts.StudentID = TransData.StudentId)) "
> sql = sql & " INNER JOIN StudentVisits ON
> (AdditionalContacts.ProviderNumber = StudentVisits.ProviderNumber) "
> sql = sql & " AND (AdditionalContacts.StudentID =
> StudentVisits.StudentId) "
> sql = sql & " WHERE (((TransData.VisitDate) Is Null)) "
>
> has run for months. Now I cannot get it to execute at all. The open
> completes without apparent error, but none of the recordset properties can be
> displayed in the command window (error: cannot obtain value).
>
> I am going to spend some time evaluating the above SQL Server statement, but
> as I said, this program has run successfully with the existing source code
> for a time. Now, it consistently breaks.
>
> Ideas?
>
> Mklapp
>
- Next message: Eric: "RE: Query tables across multiple databases with sql"
- Previous message: mklapp: "Strange behavior from ADODB and SQL Server"
- In reply to: mklapp: "Strange behavior from ADODB and SQL Server"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|