Ado.net Access connection failed  
Author Message
Altoids





PostPosted: .NET Framework Data Access and Storage, Ado.net Access connection failed Top

Hi,
I developed an application which has being used more than 100 users. Currently we found two computers that have a problem for this application.

This application accesses an Access mdb file on a remote server through ADO.net. The following is a piece of the codes
----------------------------------------------------------------------------------------
string theConnectionString =
"Provider=MS Remote;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Inetpub\\test.mdb;Remote Server=https://test.com";
connection.ConnectionString = theConnectionString;
System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand();
command.Connection = connection;
if (connection.State.ToString() == "Open")
{
Console.WriteLine("Connection Opened");
}
else
{
Console.WriteLine("Connection Failed");
}
command.CommandText = "SELECT * FROM dumy";
System.Data.OleDb.OleDbDataReader dataReader;
dataReader = command.ExecuteReader(CommandBehavior.CloseConnection);
---------------------------------------------------------------------------------------

The following is the output from the above codes:
-------------------------------------------------------------------------------------------
Connection Opened
System.Data.OleDb.OleDbException: Internet Client Error: Cannot Connect to Server. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARA
MS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleRow(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at ConsoleApplication1.Program.Main(String[] args) in C:\Documents and Settin
gs\someone\My Documents\Visual Studio 2005\Projects\ConsoleApplication1\C
onsoleApplication1\Program.cs:line 35
---------------------------------------------------------------------------------------------
One of the computers has the following configuration:
----------------------------------------------------------------------------------------------
Window XP Professional Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519 : Service Pack 2)
MADC 2.8 Sp1 ON WINDOWS XP SP2 (Validated by Component Check 2.0)
----------------------------------------------------------------------------------------------
Devlelopment environments
----------------------------------------------------------------------------------------------
VB 6
VS 2003
VS 2005
I tried all three development environment and all of them have the same problem
----------------------------------------------------------------------------------------------

FACT:
We know the codes are good because it works on other computers.
I turned off the FireWall on the computer and there is no affect.
There is no error message in the event veiwer.

QUESTIONS:
How to debug this kind of problem All I have is the above error message.

Thanks in advance

altoids



.NET Development35  
 
 
Nobuo Kai





PostPosted: .NET Framework Data Access and Storage, Ado.net Access connection failed Top

Hi,
I developed an application which has being used more than 100 users. Currently we found two computers that have a problem for this application.

This application accesses an Access mdb file on a remote server through ADO.net. The following is a piece of the codes
----------------------------------------------------------------------------------------
string theConnectionString =
"Provider=MS Remote;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Inetpub\\test.mdb;Remote Server=https://test.com";
connection.ConnectionString = theConnectionString;
System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand();
command.Connection = connection;
if (connection.State.ToString() == "Open")
{
Console.WriteLine("Connection Opened");
}
else
{
Console.WriteLine("Connection Failed");
}
command.CommandText = "SELECT * FROM dumy";
System.Data.OleDb.OleDbDataReader dataReader;
dataReader = command.ExecuteReader(CommandBehavior.CloseConnection);
---------------------------------------------------------------------------------------

The following is the output from the above codes:
-------------------------------------------------------------------------------------------
Connection Opened
System.Data.OleDb.OleDbException: Internet Client Error: Cannot Connect to Server. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARA
MS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleRow(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at ConsoleApplication1.Program.Main(String[] args) in C:\Documents and Settin
gs\someone\My Documents\Visual Studio 2005\Projects\ConsoleApplication1\C
onsoleApplication1\Program.cs:line 35
---------------------------------------------------------------------------------------------
One of the computers has the following configuration:
----------------------------------------------------------------------------------------------
Window XP Professional Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519 : Service Pack 2)
MADC 2.8 Sp1 ON WINDOWS XP SP2 (Validated by Component Check 2.0)
----------------------------------------------------------------------------------------------
Devlelopment environments
----------------------------------------------------------------------------------------------
VB 6
VS 2003
VS 2005
I tried all three development environment and all of them have the same problem
----------------------------------------------------------------------------------------------

FACT:
We know the codes are good because it works on other computers.
I turned off the FireWall on the computer and there is no affect.
There is no error message in the event veiwer.

QUESTIONS:
How to debug this kind of problem All I have is the above error message.

Thanks in advance

altoids