?
Solved

ASP Page connect to FoxPro table on a network drive

Posted on 2005-03-03
8
Medium Priority
?
956 Views
Last Modified: 2010-08-05

I wasn’t quite sure which topic I should post this under, I'm sure its something to do with an IIS setting or ASP program problem. About the problem, there is a ASP page I have created which I will post, the ASP page connects to a FoxPro .DBC and there is a table within the vehicles.dbc called fleets.dbf, the table is located on a Netware 5 server (not sure if that matters) under the address G:\All Vehicles\DATA\vehicles.dbc which is mapped on the IIS 6 server.

When the page is called I get the error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

[Microsoft][ODBC Visual FoxPro Driver]File 'fleets.dbf' does not exist.

/fleet/bmw.asp, line 35

This is my connection Syntax:

set cn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.recordset")
cn.provider = "MSDASQL.1"
connstr = "Driver={Microsoft Visual FoxPro Driver};UID=;SourceDB=G:\All Vehicles\DATA\;SourceType=DBF;" & server.mappath("Vehicles.dbc")
cn.Open connstr
set rs = cn.Execute("SELECT * FROM Fleets WHERE carryover = .T. AND client = 'BMW' ORDER by Run_num")
Do While Not rs.EOF


Another thing, when I use the table as a "Free table directory" local on the web server C:\Inetpub\wwwroot\FLEET it works great.

Thanks in advance for your help.
0
Comment
Question by:slip9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 13455420
I would start by trying to connect to the .dbc file on the same server as your web site just for testing.

Also, your connection looks a little funky...

set cn = Server.CreateObject("ADODB.Connection")
connstr ="Provider=vfpoledb;" & _
           "Data Source=C:\vfp8\Samples\Data\myVFPDB.dbc;" & _
           "Mode=ReadWrite|Share Deny None;" & _
           "Collating Sequence=MACHINE;" & _
           "Password=''"
cn.Open connstr
0
 

Author Comment

by:slip9
ID: 13455724
It works fine on the web site server, what I need it to do is connect to the table on a mapped network drive. Reason being is this table on the network is being updated, and this webpage refreshes every minute to show the latest data. I have tried many connection methods and they all work on local drives it's just when it’s on a network drive. Thanks again.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 13455752
Okay, if you have this working on your web server, that means that we have everything set in terms of the connection issue, which brings us to permissions. What happens if you use the same code I gave you now for the shared drive?

You have to make sure that the IUSR_ account has read/write permissions to the directory housing your database.

ftB
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:slip9
ID: 13456003
The error is:

 Microsoft OLE DB Provider for Visual FoxPro error '80040e21'

Invalid path or file name.

/fleet/bmw.asp, line 38

Using this connection:

set cn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.recordset")
connstr ="Provider=VFPOLEDB.1;" & _
           "Data Source=G:\All Vehicles\DATA\vehicles.dbc;" & _
           "Mode=ReadWrite|Share Deny None;" & _
           "Collating Sequence=MACHINE;" & _
           "Password=''"
cn.Open connstr

Just tested it local and it worked.


How do I check if IUSR_account has read/write permissions? I'm using IIS 6 on 2003 server. Another thing when I tried to add a virtual path in IIS to this path where the table is G:\All Vehicles\DATA\ the OK button was greyed out and wouldnt not let me select it, not sure if this helps.

Thanks again,
Slip9


0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 2000 total points
ID: 13463122
I am not sure how you can set the permissions for a netware server. But the reason why you are getting an invalid path is because the IUSR account doesn't even have permissions to check the shared drive, so it comes up as a bad path...

Perhaps a UNC path instead?

FtB
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question