J
Jean-Francois Hamelin
Hi,
I have a web service that tries to fetch data from a Visual FoxPro database
sitting on a remote PC. The database is accessible by a file share with
everyone set to full control.
IIS and ASP.NET authentication are set to use windows integrated and
impersonate is true.
I can open the connection to the database, but I received an exception when
accessing the tables. The exception is
{@"ERROR [S1000] [Microsoft][ODBC Visual FoxPro Driver]Cannot open file
\\remotePC\database\MyTable.dbf." }
This is the code:
[WebMethod]
public void HelloWorld()
{
OdbcConnection con = new OdbcConnection( "DSN=MyDSN" );
OdbcCommand myCommand = new OdbcCommand( "SELECT * FROM MyTable", con );
con.Open();
try
{
OdbcDataReader myReader = myCommand.ExecuteReader();
while( myReader.Read() )
{}
}
catch( Exception exception )
{
string ex = exception.Message;
// ex = {@"ERROR [S1000] [Microsoft][ODBC Visual FoxPro
Driver]Cannot open file \\remotePC\database\MyTable.dbf." }
}
}
Same code, same database, same table, and same DSN in a console application
does not generate an exception.
Any ideas why it does not work ?
Thanks
JF
I have a web service that tries to fetch data from a Visual FoxPro database
sitting on a remote PC. The database is accessible by a file share with
everyone set to full control.
IIS and ASP.NET authentication are set to use windows integrated and
impersonate is true.
I can open the connection to the database, but I received an exception when
accessing the tables. The exception is
{@"ERROR [S1000] [Microsoft][ODBC Visual FoxPro Driver]Cannot open file
\\remotePC\database\MyTable.dbf." }
This is the code:
[WebMethod]
public void HelloWorld()
{
OdbcConnection con = new OdbcConnection( "DSN=MyDSN" );
OdbcCommand myCommand = new OdbcCommand( "SELECT * FROM MyTable", con );
con.Open();
try
{
OdbcDataReader myReader = myCommand.ExecuteReader();
while( myReader.Read() )
{}
}
catch( Exception exception )
{
string ex = exception.Message;
// ex = {@"ERROR [S1000] [Microsoft][ODBC Visual FoxPro
Driver]Cannot open file \\remotePC\database\MyTable.dbf." }
}
}
Same code, same database, same table, and same DSN in a console application
does not generate an exception.
Any ideas why it does not work ?
Thanks
JF