Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 980
  • Last Modified:

ASP Page connect to FoxPro table on a network drive


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
slip9
Asked:
slip9
  • 4
  • 2
1 Solution
 
fritz_the_blankCommented:
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
 
slip9Author Commented:
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
 
fritz_the_blankCommented:
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
Independent Software Vendors: 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!

 
slip9Author Commented:
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
 
fritz_the_blankCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now