Networked DBFs

Topics: User Forum
Oct 16, 2009 at 9:14 AM

Hi Claude,

First, thank you very much for your great product.

I read on the manual of ActiveVFP and see a topic about networked DBFs. After reading it through, I still not figure out how to access a VFP DBF over network. Says, I have a VFP database located in the server, client machine connected to server via Intranet or Internet. How can I open tables in VFP database on the server with this configuration?

regards

 

Coordinator
Oct 16, 2009 at 9:56 AM

Did you set up the activevfp.dll in COM+?  If not, follow the instructions in the docs for setting up COM+.  The issue is security - you must set up the dll so that it impersonates a user account that has enough rights to access the data across the network.

 

Oct 17, 2009 at 2:26 AM

Yes, I did all steps in the docs. But I don't know how the client machine can use a DBF in the server. My need is that the database be located on the server, client will then send the queries (i.e SELECT entries..) to server, server will process it and return the result to client. Can this be done with your product? Thank you

Coordinator
Oct 17, 2009 at 4:00 AM

Well your vfp web application resides on the iis web server, correct?  Within that web app you're reading and writing to a foxpro database on another server, correct?  Have you tried doing this yet?

ActiveVFP is for web applications.  Are you trying to create a web application?

Oct 17, 2009 at 4:06 AM

yes, correct. The vfp web application resides on iis web server. I am writing a client in VFP to access foxpro database on iis server(with vfp web running) via internet. Does activeVFP support this kind of connection? Thank you

Oct 17, 2009 at 8:10 AM

Maybe this will help.

What we have done is.

1) Modified the Main.prg  program file in VFP which does all the queries and access to the local database/table on the server. Compiled main.prg

2) Remember to specify the location of the tables on the server in your main.prg program file.

3) Registered the application DLL as shown in the documentation (networked DBFs) otherwise adding data to the tables via html page will give access error.

4) Create webpages using any html editor to send the queries to the server. (Frontpage sometimes formats the html code and this causes errors)

5) Using osession.value and orequest.querystring extensively to store variables and settings

5) Tested using iexplorer on http://localhost/MyAppRegisteredInISS/default.asp

6) If that works fine you will be able to access the data via html page on eg. http://IpAddress/MyAppRegisteredInISS/default.asp

7) Every time you make changes to the main.prg file remember to compile again.

8) Remember antivirus apps/firewall can cause havoc in accessing the html.

I hope this will help you

regards

Hendrik Labuschagne

 

Oct 18, 2009 at 10:40 AM

Thank you very much, Hendrik. I will give it a try.

 

Coordinator
Oct 19, 2009 at 5:49 PM

Here's my scenario.  I copied the data folder and files from D:\maxonline\data (local drive) to O:\maxonline\data (networked drive) and modified the main.prg to lcDataPath = 'O:\maxonline\data'.  Then I open the browser to call this

http://localhost/maxonline/default.aspx?action=simplelist

and it's giving me this error.

Caught .NET exception, source: 00007ort000e err#= 1 line= 13 File 'customer.dbf' does not exist.1 File 'customer.dbf' does not exist. customer.dbf .NULL. .NULL. .NULL. .NULL. c:\program files\dotcomsolution\avfpdemo41\activevfp.dll message: c:\program files\dotcomsolution\avfpdemo41\activevfp.dll

Why is it referencing 'c:\program files\dotcomsolution\avfpdemo41\activevfp.dll'?

Any tips how can I resolve this?


 

Coordinator
Oct 19, 2009 at 6:21 PM

Well first make sure you can access O:\maxonline\data from regular vfp or file manager or something. 

Once that's done you'll need to set up COM+ as stated before in order to impersonate a user with proper rights to use the data.

Activevfp.dll is being referenced since your main.prg is an external part of that activevfp.dll.

Coordinator
Oct 19, 2009 at 6:37 PM
Edited Oct 19, 2009 at 7:04 PM

#1 Is not an issue since I can go to VFP command line and issue then browse it normally.

 

USE O:\maxonline\data\customer

 

#2 Is the one that unclear to me, specifically with the following from the documentation:

COM + Setup Instructions for a VFP mtdll (on Windows2000):

7.) select your Visual FoxPro mtdll from the list and it is added to this COM+ app.

for # 7, as soon as I choose 'Import component that are already registered' which component/file should I choose a or b?

a. maxonline.dll (my application) that I should choose.  It got 3 entries in the Choose Component to Import (maxonline.c1; maxonline.server; maxonline.threadmanager).  Assuming it's one of the 3, maxonline.dll should

also be coming/created when I open the maxonline.pjx and building it as Multi-threaded COM server (DLL) in my build options in VFP right? or;

b. activevfp.dll (found in C:\Program Files\dotComSolution\AVFPdemo41)

Please advice.

Thanks.

claudefox wrote:

Well first make sure you can access O:\maxonline\data from regular vfp or file manager or something. 

Once that's done you'll need to set up COM+ as stated before in order to impersonate a user with proper rights to use the data.

Activevfp.dll is being referenced since your main.prg is an external part of that activevfp.dll.

 

Coordinator
Oct 19, 2009 at 7:58 PM

Ohhhh.  The new version 4 architecture uses activevfp.dll and main.prg so you don't create your own mtdll anymore unless you're changing some base behaviour. 

Are you using the new architecture or is your main.prg compiled within your mtdll?? 

 

Coordinator
Oct 19, 2009 at 8:17 PM

Well, I'm assuming that I'm using the new architecture, but also edited the main.prg under the folder maxoline\prg.

Basically, after I installed AVFP41setup.exe here are the following steps i made:

  1. Run WebAppBuilder and use maxonline as App Name and the default location is under d:\maxonline.  After generating the files and default page launch, I open the maxonline project (make it default directory, since VFP ask)
  2. I modified main.prg function AVFPinit making lcDataPath = 'o:\maxonline\data'.  I copied the files under the local folder D:\maxonline\data\maxonline to o:\maxonline\data.  I then saved the main.prg and compile it.  I also build the project as Multi-Threaded (DLL) creating the maxonline.dll

When you say that I don't have to create my own mtdll anymore, then I'm assuming that when I created a COM+ app, I will be using the activevfp.dll which is basicall item B on my last post prior to this.  Am I on the right track?

 

Coordinator
Oct 19, 2009 at 9:03 PM

yes, it's just main.prg and activevfp.dll now.  So COM+ would be for activevfp.dll. 

Don't build your own mtdll anymore.  Just modify main.prg and the html templates.