Re: Providers: DSN vs DSNLess. Data Returned is different?

From: Brannon Jones (brannonjNOSPAM_at_gmail.com)
Date: 08/19/04


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
>



Relevant Pages

  • Re: connecting to sql server from asp page
    ... In your DSN, if you include the login and password, then you are specifying ... Connectivity client application are always ignored by SQL Server ... You have two choices - either supply the uid and pwd in the connection open ... to used both Windows and Sql Server authentication. ...
    (microsoft.public.sqlserver.connect)
  • 2147217865 Error Message Attempting to Populate a RecordSet from a DB2 Database
    ... I'm attempting to populate a recordset from a DB2 instance. ... establish the connection with the database using a DSN as follows (I've ... replaced the DSN Name, username, and password with placeholders. ... Private Function getSequence(strWRK_CDE As String, ...
    (microsoft.public.data.ado)
  • Re: Linking to back end on a web server ?
    ... When I do the File--Get External Data and select the DSN, ... "You cannot use ODBC to import from, export to, or link an external ... Microsoft Jet or ISAM database table to your database. ... that DSN-based connection to a DSN-less connection. ...
    (microsoft.public.access.externaldata)
  • Re: How to Upgrade SQL back end of Access linked tables.
    ... If the file's extension is ADP then this is where your error is: ... you directly connect to a SQL-Server and this connection is using ... so there is no notion of DSN or DSN-Less ... dsn-less connection to SQL Server? ...
    (microsoft.public.access.externaldata)
  • Re: How to Upgrade SQL back end of Access linked tables.
    ... you directly connect to a SQL-Server and this connection is using ... so there is no notion of DSN or DSN-Less ... Sylvain Lafontaine, ing. ... I didn't have linked table manager under ...
    (microsoft.public.access.externaldata)

Quantcast