Visual FoxPro OLEDB error: Invalid path or file name

断了今生、忘了曾经 提交于 2019-12-22 12:27:25

问题


We have Novell server and there Advantage Database Server 9.1 is installed and all other Xbase++ programs access DBF files from that location. I want to access DBF files from C# asmx webservice.

Problem is if I use Visual FoxPro VFP OLEDB then it only works while running asmx webservice in Visual studio's Debug mode but when I publish it to IIS, it gives this error:

System.Data.OleDb.OleDbException: Invalid path or file name

First Attempt (with ADS OLEDB):

It works ONLY when DBF files are not opened by non-ADS program. If any Xbase++ program first opens DBF file then "Locking situation" occurs and I can't access DBF file.

ADS connection string:

string connectionString = string.Format(@"Provider=Advantage OLE DB Provider;data source={0}; Advantage Server Type=ADS_REMOTE_SERVER;SecurityMode=ADS_IGNORERIGHTS;TableType=ADS_CDX;Locking=ADS_COMPATIBLE_LOCKING;", folderPath);

Second Attempt (with VFP OLEDB):

Then I tried VFP OLEDB but it only works when I run asmx webservice from Visual Studio's Debug mode and does not work after deployment to IIS, when I publish webservice to IIS it gives this error:

System.Data.OleDb.OleDbException: Invalid path or file name.
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()

VFP connection string:

string connectionString = string.Format(@"Provider=vfpoledb.1;data source={0}; TableType=vfp;", folderPath);

来源:https://stackoverflow.com/questions/29952445/visual-foxpro-oledb-error-invalid-path-or-file-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!