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.
slip9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.