I have to integrate an older COM library with an ASP.NET application. The library loads Fox Pro DBF files into a MSSQL database. The call to the libraryís main method results in the following error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
. The library works fine with the old ASP site and also works fine when called from a .Net console application.
I presumed that the error was due to insufficient rights of the ASPNET user account and I tried to impersonate my current user account which is member of the Administrator group (the old ASP application uses Windows Authentication). It didnít work, neither with impersonation at web.config level, nor with impersonation at page level using the Win 32 LogonUser method.
I tested the library using vbs scripts and the runas
command line utility and I got the following results:
1. The piece of code causing the trouble is (the error is thrown when the connection opens):
sConnString = "DSN=Visual FoxPro Tables;" & _
"SourceDB=C:\Temp;" & _
"SourceType=DBF;" & _
Set oConnDBF = CreateObject("ADODB.Connection")
2. The code works only under my current user account (it does not work even under the Administrator account)
3. The code works fine for any user when I use the /noprofile
argument of the runas
From that I deduct that the error is not due to missing security permissions, but to the Windows profile of the user under which the code executes (that explains why impersonation doesnít work). Maybe this has something to do with the fact that the Visual Fox Pro ODBC driver has been discontinued since MDAC version 2.6. I have installed MDAC 2.6 over MDAC 2.8 because the library explicitly required this version. The installation was carried out under my account and maybe the driver seems to be not installed for the other accounts.
I checked the registry key for the ODBC driver (HKLM/Software/ODBC) and the permissions granted on it were fine, so this is not the problem.
Thanks for any advice