Link to home
Start Free TrialLog in
Avatar of alitor99
alitor99

asked on

Microsoft OLE DB Provider for ODBC Drivers error '80040e37' [Microsoft][ODBC Visual FoxPro Driver]File 'mssupp.dbf' does not exist.

I am trying to connect to a Visual FoxPro table on my web page using ASP, but I keep getting the error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC Visual FoxPro Driver]File 'mssupp.dbf' does not exist.
The following code used in an Access database works and creates a linked table:

Dim tdfLinked As TableDef
Dim dbs As Database
Dim strSQL As String
Dim strConnect As String
Set dbs = CurrentDb
Set tdfLinked = dbs.CreateTableDef(strTable)
strConnect = "ODBC;DSN=LofmapSuppliers;PASSWORD=;UID=;SourceDB=i:\Live\Lofmap Pro\data;" & _
            "SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;"
tdfLinked.Connect = strConnect
tdfLinked.SourceTableName = "mssupp"
dbs.TableDefs.Append tdfLinked

The following code in an .asp page fails, no matter which connection string I use, and generates the error mentioned :

<%
Dim strFPconn
Dim objConn
Dim objRS
Dim varArray

strFPconn = "DSN=LofmapSuppliers;PASSWORD=;UID=;SourceDB=i:\Live\Lofmap Pro\data;" & _
                  "SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;TABLE=mssupp;"

strConnect = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;" & _
                    "SourceDB=i:\Live\Lofmap Pro\data;TABLE=mssupp;"

Set objConn = server.CreateObject("ADODB.Connection")

strSQL = "SELECT * FROM mssupp"
'objConn.Open strFPconn
objConn.Open strConnect
Set objRS = objConn.Execute(strSQL)
If objRS.eof then
      Response.Write "There is no recordset"
else
      objRS.MoveLast
      objRS.moveFirst
      Response.Write "There are this many records ; " & objRS.RecordCount
      varArray = objRS.getrows
end if
objRS.close
set objRS = nothing
objConn.Close
set objConn = Nothing      
%>

Further, I have tried to connect to the linked FoxPro table in the Access database. However this also generates an error :

Microsoft JET Database Engine error '80004005'

ODBC--connection to 'mssupp' failed.

Can anyone advise me what is wrong and how I can successfully connect to the FoxPro table?
Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

I am not sure but could be this

SourceDB=i:\Live\Lofmap Pro\data

"Lofmap Pro" there is space in here

SourceDB="i:\Live\Lofmap Pro\data"
Avatar of alitor99
alitor99

ASKER

I have copied the table over to another location where there is no space in the path and I get all the same errors.
So I assume that is not the cause of my problem.
"I:"  is a network drive, right? It is available only on your local system, not from web server.
Replace "I:" with UNC path (\\Server\path\...) and try again.

D'Al
<<<strFPconn = "DSN=LofmapSuppliers;PASSWORD=;UID=;SourceDB=i:\Live\Lofmap Pro\data;" & _
                 "SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;TABLE=mssupp;"

strConnect = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;" & _
                   "SourceDB=i:\Live\Lofmap Pro\data;TABLE=mssupp;"

>>

does it have to end with ";" ....?
I think it's a security problem accessing a networked drive under IIS. Check :

HOWTO: Accessing Network Files from IIS Applications
Q207671

on MSDN
PRB: Accessing FoxPro Table in ASP Returns Error 80040e14
http://support.microsoft.com/default.aspx?scid=kb;en-us;175801
Samopal,
Yes, you are right, I am trying to connect to another server from my web server. However, the web server has the path mapped for the i: drive. Further, I have tried the full UNC path. Both paths give me the same error as mentioned in the subject line.
Suhas,
I have removed the final semi-colon to no avail.
You cannot access another server through a web server using an Internet user. You need to create a normal user to have access to the remote data. IIS does not let you do this. user IWAM does not work. Create a normal user.
Read what my and Carl's message says.
It's not an Foxpro problem but IIS.
Can you read write to that path say using an ADO.Stream ?
Cetin,
I have copied the mssupp.dbf file and its respective .cdx file over to the web server. This should cover the issues raised by accessing a network drive from IIS.
Yet again the results are exactly the same. I can access the table in Access without any problem. But when I try to access the table through a web page I get the file not found error still.
Carl,
The thrust of the article you referenced is the same as the point raised by Cetin. Further, I would point out that the error number I get is 80040e37, not 80040e14 that this article covers
ASKER CERTIFIED SOLUTION
Avatar of cbasoz
cbasoz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Create a user for that part of IIS to access the tables only through this user. This user must have at least read priveledges on that remotely shared data. Click on remember password so for the OS not to prompt you to enter the password again.
This way IIS can have access to the remote data at all times.
What version of the connectivity drivers for Visual FoxPro do you think you are using?  Are they the latest ones?

Are you using ODBC or the OLE DB PRovider for VFP?  Where did you get the OLE DB Privider for VFP?

Latest version links for each:

Visual FoxPro ODBC Driver
http://msdn.microsoft.com/vfoxpro/downloads/updates/odbc/default.aspx

Microsoft OLE DB Provider for Visual FoxPro
http://www.microsoft.com/downloads/details.aspx?FamilyId=0F43EB58-7A94-4AE1-A59E-965869CB3BC9&displaylang=en
This link might also pertain and is a short solution:

PRB: Problems with Visual FoxPro Driver "Fetch Data In Background" Option
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q269881

As for the previous reference I gave yesterday, even though that error code is different, it seems it's still related to the error code you are getting in many instances.  I still believe that reference could apply, if the one I just posted above doesn't get it done for you, and it offers numerous possibilities that you could be looking at to determine your exact problem.

Reposting it:

PRB: Accessing FoxPro Table in ASP Returns Error 80040e14
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q175801

One Other reference:

http://www.leafe.com/archives/showMsg/77008

If the previous links don't help (they should have), another general reference not specific to FoxPro:

Ignore the reference in this article to "Commerce Server" and see whether the resolution offered pertains based on the error code rather than the MS product reference:

Err Msg: Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q197/4/63.asp&NoWebContent=1