473,386 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Pass-through queries fail even after SQL Server reconnected

I have an Access 2000 mde application which uses ADO and pass through
queries to communicate with SQL Server 7, 2000 or 2005.

Some of my customers, especially those with SQL Server 2005, have had
pass-through queries fail due to intermittent connection failures.

I can easily restablish a connection for ADO.

My problem is with pass-through queries.

It appears from my experiments that MSAccess establishes a connection
to the SQL Server the first time it runs a pass-through query. It then
tries to use that same connection whenever any later pass-through
queries are run.

If there is a network problem or the SQL Server temporarily goes
offline or the SQL Server rejects the connection for whatever reason,
any later attempts to use pass-through queries fail, even after the
SQL Server is back online and connected via ADO.

The first one to fail returns the following error message:

ODBC--call failed.
[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionWrite
(WrapperWrite()). (#55) [Microsoft][ODBC SQL Server Driver][Shared
Memory]General Network Error. Check your network documentation. (#11)

Subsequent failures return:

ODBC--call failed.
[Microsoft][ODBC SQL Server Driver]Communication link failure (#0)

Obviously these errors are telling me to fix something in the network
or SQL Server.

Unfortunately the networks and SQL Servers where my application is
deployed are not under my control.

I just want to accept the fact the connection has been interrupted and
establish a fresh connection.

I have tried using DAO to create a querydef object from the query and
reset its connection string. The code runs but the queries still fail.

Likewise I have tried using ADOX to reset the Pass Through Query
Connect String property of the command of the relevant procedure in
the ADOX catalog . The code runs but the queries still fail.

I tried closing and reopening the application without closing Access.
The queries still fail.

If I close Access altogether then reopen it and the application, the
queries work again.

Also, if leave the application open and wait a long time (e.g. half an
hour), the queries work again.

I don't want my users to have to wait half an hour or close and reopen
Access.

Is there some property I can set or method I can run on the Access
instance that will allow my pass-through queries to run again once the
SQL Server is back online?

I have tried setting all the various cryptically-named intervals that
appear in the Access 2000 Tools/Options/Advanced dialog to low
numbers. It makes no difference.

Does anyone have any suggestions?

Mike
Jun 27 '08 #1
5 6292
On Wed, 30 Apr 2008 17:49:37 -0700 (PDT), ma***********@yahoo.com
wrote:

In my experience "General Network Error" is a very serious event and
indicates (perhaps intermittent) network connectivity problems. Think
of the entire chain between the client machine and the server machine:
the cables, the nic, the switch, some part of it is intermittently
failing and until it is identified and fixed there is little software
can do.

ODBC is a pretty old way to connect to SQL Server. I think no
development has been going on there for many years. At least consider
upgrading to OLEDB. Of course the real development is with ADO.NET,
but then you're leaving the realms of Access.

-Tom.
>I have an Access 2000 mde application which uses ADO and pass through
queries to communicate with SQL Server 7, 2000 or 2005.

Some of my customers, especially those with SQL Server 2005, have had
pass-through queries fail due to intermittent connection failures.

I can easily restablish a connection for ADO.

My problem is with pass-through queries.

It appears from my experiments that MSAccess establishes a connection
to the SQL Server the first time it runs a pass-through query. It then
tries to use that same connection whenever any later pass-through
queries are run.

If there is a network problem or the SQL Server temporarily goes
offline or the SQL Server rejects the connection for whatever reason,
any later attempts to use pass-through queries fail, even after the
SQL Server is back online and connected via ADO.

The first one to fail returns the following error message:

ODBC--call failed.
[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionWrite
(WrapperWrite()). (#55) [Microsoft][ODBC SQL Server Driver][Shared
Memory]General Network Error. Check your network documentation. (#11)

Subsequent failures return:

ODBC--call failed.
[Microsoft][ODBC SQL Server Driver]Communication link failure (#0)

Obviously these errors are telling me to fix something in the network
or SQL Server.

Unfortunately the networks and SQL Servers where my application is
deployed are not under my control.

I just want to accept the fact the connection has been interrupted and
establish a fresh connection.

I have tried using DAO to create a querydef object from the query and
reset its connection string. The code runs but the queries still fail.

Likewise I have tried using ADOX to reset the Pass Through Query
Connect String property of the command of the relevant procedure in
the ADOX catalog . The code runs but the queries still fail.

I tried closing and reopening the application without closing Access.
The queries still fail.

If I close Access altogether then reopen it and the application, the
queries work again.

Also, if leave the application open and wait a long time (e.g. half an
hour), the queries work again.

I don't want my users to have to wait half an hour or close and reopen
Access.

Is there some property I can set or method I can run on the Access
instance that will allow my pass-through queries to run again once the
SQL Server is back online?

I have tried setting all the various cryptically-named intervals that
appear in the Access 2000 Tools/Options/Advanced dialog to low
numbers. It makes no difference.

Does anyone have any suggestions?

Mike
Jun 27 '08 #2
Thanks Tom,

This is a big old application and I'm stuck with pass-through queries.

I'm also not in a position to exert much influence on the IT
departments of our numerous customers. I suspect that the real culprit
is SQL Server 2005 closing connections that are still needed. Our SQL
Server 7 and 2000 customers have not reported this problem.

Ideally I'd like to find a solution that lets my app reconnect
whatever the cause of the lost connection.

Does anyone have any other ideas, especially on how to tell Access to
renew/replace the connection it uses for pass-through queries?

Mike
On May 1, 2:12*pm, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On Wed, 30 Apr 2008 17:49:37 -0700 (PDT), marshmallo...@yahoo.com
wrote:

In my experience "General Network Error" is a very serious event and
indicates (perhaps intermittent) network connectivity problems. Think
of the entire chain between the client machine and the server machine:
the cables, the nic, the switch, some part of it is intermittently
failing and until it is identified and fixed there is little software
can do.

ODBC is a pretty old way to connect to SQL Server. I think no
development has been going on there for many years. At least consider
upgrading to OLEDB. Of course the real development is with ADO.NET,
but then you're leaving the realms of Access.

-Tom.
I have an Access 2000 mde application which uses ADO and pass through
queries to communicate with SQL Server 7, 2000 or 2005.
Some of my customers, especially those with SQL Server 2005, have had
pass-through queries fail due to intermittent connection failures.
I can easily restablish a connection for ADO.
My problem is with pass-through queries.
It appears from my experiments that MSAccess establishes a connection
to the SQL Server the first time it runs a pass-through query. It then
tries to use that same connection whenever any later pass-through
queries are run.
If there is a network problem or the SQL Server temporarily goes
offline or the SQL Server rejects the connection for whatever reason,
any later attempts to use pass-through queries fail, even after the
SQL Server is back online and connected via ADO.
The first one to fail returns the following error message:
ODBC--call failed.
[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionWrite
(WrapperWrite()). (#55) [Microsoft][ODBC SQL Server Driver][Shared
Memory]General Network Error. Check your network documentation. (#11)
Subsequent failures return:
ODBC--call failed.
[Microsoft][ODBC SQL Server Driver]Communication link failure (#0)
Obviously these errors are telling me to fix something in the network
or SQL Server.
Unfortunately the networks and SQL Servers where my application is
deployed are not under my control.
I just want to accept the fact the connection has been interrupted and
establish a fresh connection.
I have tried using DAO to create a querydef object from the query and
reset its connection string. The code runs but the queries still fail.
Likewise I have tried using ADOX to reset the Pass Through Query
Connect String property of the command of the relevant procedure in
the ADOX catalog . The code runs but the queries still fail.
I tried closing and reopening the application without closing Access.
The queries still fail.
If I close Access altogether then reopen it and the application, the
queries work again.
Also, if leave the application open and wait a long time (e.g. half an
hour), the queries work again.
I don't want my users to have to wait half an hour or close and reopen
Access.
Is there some property I can set or method I can run on the Access
instance that will allow my pass-through queries to run again once the
SQL Server is back online?
I have tried setting all the various cryptically-named intervals that
appear in the Access 2000 Tools/Options/Advanced dialog to low
numbers. It makes no difference.
Does anyone have any suggestions?
Mike- Hide quoted text -

- Show quoted text -
Jun 27 '08 #3
Greetings,

As Tom pointed out, ODBC is old technology, and my guess is that Sql
Server 2005 is trying to migrate away from ODBC. The problem with ODBC
is that it is a continuous connection where ADO connects and disconnects
for each call. Most likely, these ODBC connection failures are really
"Deadlocking" issues. Not only does Access not deal with deadlocking -
it does not give a very informative error message.

Microsoft went all out to resolve the deadlocking problems with the
development of .Net (ADO.Net), and they did a real nice job. For a
multi user environment - deadlocking is always a major issue. With
ADO.Net, when multiple users hit the same table/record at the same time
- ADO.Net will set up a sort of qeue and gives a message (not too pretty
of a message - something about Transaction has been put on a qeue - but
the word "Failure" is not included in the message) -- you just click OK,
and your transaction gets processed next.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #4
On Thu, 1 May 2008 02:48:12 -0700 (PDT), ma***********@yahoo.com
wrote:

I'm sorry the news isn't any better. Here is a possible solution:
perhaps we are timing out, and if that's so, maybe it would help if we
ran a very quick query (select * from EmptyTable where ID=-1) based on
a 1-minute timer.

Another far-fetched possibility: perhaps you could experiment with
workspace.IsolateODBCTrans.

Did you see this comment in the OpenRecordset documentation: You
should also use the dbSeeChanges constant if you open a Recordset in a
Microsoft Access database engine-connected ODBC workspace against a
Microsoft SQL Server 6.0 (or later) table that has an IDENTITY column,
otherwise an error may result.

Can you post a simple example of the source code you're using?

-Tom.
>Thanks Tom,

This is a big old application and I'm stuck with pass-through queries.

I'm also not in a position to exert much influence on the IT
departments of our numerous customers. I suspect that the real culprit
is SQL Server 2005 closing connections that are still needed. Our SQL
Server 7 and 2000 customers have not reported this problem.

Ideally I'd like to find a solution that lets my app reconnect
whatever the cause of the lost connection.

Does anyone have any other ideas, especially on how to tell Access to
renew/replace the connection it uses for pass-through queries?

Mike
<clip>
Jun 27 '08 #5
Thanks Tom,

Sending a quick query every minute is a good idea. In fact I've had
that idea too and have already built it into the next version of our
application. I'm hoping it will prevent many of the losses of
connection.

But I was also hoping for a more comprehensive solution in case of
loss of connection for any other reason.

I tried setting workspace.IsolateODBCTrans to true but it made no
difference.

Re your dbSeeChanges suggestion, unless I've misunderstood,the problem
is not related to recordsets as such. Only to pass-through queries.

Posting code would be a bit beside the point. Although the querires
are nomally called from code, the problem still manifests itself
without any code running.

Thanks for trying.

I think my next move will be to try Microsoft's own Access newsgroup
in case the authors of the problem are lurking there.

Mike

Mike
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

110
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
4
by: z_learning_tester | last post by:
I'm reading the MS press C# book and there seems to be a contradiction. Please tell me which one is correct, 1 or 2. Thanks! Jeff 1. First it gives the code below saying that it prints 0 then...
14
by: Abhi | last post by:
I wrote a function foo(int arr) and its prototype is declared as foo(int arr); I modify the values of the array in the function and the values are getting modified in the main array which is...
3
by: QQ | last post by:
I have one integer array int A; I need to pass this array into a function and evaluate this array in this function how should I pass? Is it fine? void test(int *a)
31
by: Sam of California | last post by:
Is it accurate to say that "the preprocessor is just a pass in the parsing of the source file"? I responded to that comment by saying that the preprocessor is not just a pass. It processes...
4
by: kinaxx | last post by:
Hello, now I'm learning progamming language in university. but i have some question. in textbook. says there are four passing Mechanism 1) pass by value (inother words : call by value) 2)...
11
by: kinaxx | last post by:
Hello, now I'm learning progamming language in university. but i have some question. in textbook. says there are four passing Mechanism 1) pass by value (inother words : call by value) 2)...
10
by: Robert Dailey | last post by:
Hi, I noticed in Python all function parameters seem to be passed by reference. This means that when I modify the value of a variable of a function, the value of the variable externally from the...
6
by: lisp9000 | last post by:
I've read that C allows two ways to pass information between functions: o Pass by Value o Pass by Reference I was talking to some C programmers and they told me there is no such thing as...
15
by: ramif | last post by:
Does call by reference principle apply to pointers?? Is there a way to pass pointers (by reference) to functions? Here is my code: #include <stdio.h> #include <stdlib.h>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.