Last post Jul 07, 2016 06:28 PM by .NETftw
Jul 06, 2016 07:23 PM|.NETftw|LINK
I am receiving the below error message when trying execute a sql query on a backend access database. This error only happens when the table/query I am trying to query has linked tables on a server. However I don't get that error message when the access table/query
has a linked table on my local C: drive. It only happens when the linked table is on the server. I have the linked table mapped with the full fqdn and can execute the c# sql query by going into the database itself. Has anyone seen this issue before?
Full Error Message:
An exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll but was not handled in user code
Additional information: Your network access was interrupted. To continue, close the database, and then open it again.
DataTable dtblResults = new DataTable();
//Query the data
cmd = conn.CreateCommand();
cmd.CommandText = strQuery;
cmd.CommandType = CommandType.Text;
OleDbDataReader reader = cmd.ExecuteReader(); //This is where the error happens.
//Save the results to a DataTable
//Put the results in a dataset
DataSet dsResult = new DataSet();
Jul 06, 2016 11:14 PM|PatriceSc|LINK
And the linked table is? If not on the same server keep in mind that the web app runs under an account that is perhaps not allowed to access this network resource (or even network resources at all).
My personal preference would be likely to access directly to the target tables without going through the attached tables (you could also test that to just check that the final target table can be reached from your web server).
Jul 07, 2016 05:31 AM|Yohann Lu|LINK
The problem sounds like an unstable LAN connection OR changes the LAN location causing increased latency. The message means that your network connection to the database was lost. either because of a network problem or the database was moved while you had
it open. You can close and reopen the database on your end (code).
The following links may be helpful for you.
Your network access was interrupted. To continue close the database and then open it again. Windows 7:
Your network access was interrupted:
Jul 07, 2016 06:28 PM|.NETftw|LINK
Ahh.. For some reason the impersonate tag in the web.config file was commented out. That is the reason it didn't have permission to access the database on the server. Thanks for the help.