Re: Providers: DSN vs DSNLess. Data Returned is different?
From: Brannon Jones (brannonjNOSPAM_at_gmail.com)
Date: 08/19/04
- Next message: rschuchm: "SQLBindParameter"
- Previous message: Joshua Belden: "Providers: DSN vs DSNLess. Data Returned is different?"
- In reply to: Joshua Belden: "Providers: DSN vs DSNLess. Data Returned is different?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Aug 2004 10:12:21 -0700
Are you using SQL Server?
DSNs are basically a mechanism to save and set connection attributes at
connect time. So if you are seeing a difference, then it's likely because
the DSN is setting some attribute that you aren't setting in the DSN-less
codepath.
Also, if the order of statements is making a difference, try using
SQLMoreResults() after each statement to make sure any pending data on the
wire has been processed. Call SQLMoreResults() in a loop until it returns
SQL_NO_DATA.
Other drivers may behave differently. I'm speaking mostly about the SQL
Server driver.
Brannon
"Joshua Belden" <JoshuaBelden@discussions.microsoft.com> wrote in message
news:61EC1411-DC70-400D-A14B-7F172C9B7F55@microsoft.com...
> After a day of debugging, I've come to find out that whether you use a
> DSNLess connection or a DSN does make a difference.
>
> I had a piece of problem code that called a stored procedure and returned
a
> recordset. Using ASP I found that the recordset was always closed even the
QA
> returned a record running the identical procedure call. I tracked the
issue
> further to find that in my procedure I did a Select, than an Update, than
a
> final select. If I moved the Update to the bottom, it ran fine, if I moved
> the update before the final select, it would not run. This made no sense
to
> me at all.
>
> It turns out that I was using a dsnless connection, and the live code that
> was working just fine was using a DSN. I didn't realize that there would
be
> such a difference in the providers. Does anyone know where I can find what
> else I'm going to run into by using a DSNLess connection vs a DSN?
>
> My original post that started the thread:
>
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.data.ado&lang=en&cr=US&mid=88627c7d-9b5b-44e6-8c3e-b42077b241c8
> Modified=307415910486C40199
>
- Next message: rschuchm: "SQLBindParameter"
- Previous message: Joshua Belden: "Providers: DSN vs DSNLess. Data Returned is different?"
- In reply to: Joshua Belden: "Providers: DSN vs DSNLess. Data Returned is different?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|