Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Questions about Web applications for a Web beginner 2

Status
Not open for further replies.

Stella740pl

Programmer
Jul 3, 2003
2,657
US

Hi, everyone!

I've never written a Web application, or a Web anything, for that matter, so bear with me, please.

We are currently using VFP6 SP5. Under current procedure, another person takes tables and reports produced by my VFP6 desktop application, and converts them to SQL Server and PDF files respectively, to use them in his Web application (not VFP).

Now, when I was discussing with our manager a possibility of getting an upgrade to VFP9, he said that if it will allow us to skip the conversions mentioned above and just use FoxPro tables and reports on the Web, then he might be more willing to upgrade. Or, rather, if VFP in general, even our current VFP6, can do it, then it would make more sense to upgrade to a better version of a great product like this.

As far as I know, people are using .DBFs on the Web (and this capability existed before VFP9, am I right?), I just don't know how yet.

I am not sure, though, if it's possible to run the reports right from the Web, instead of creating PDFs or other such files.

Are any additional products, libraries, tools are required to create a FoxPro Web application?

Can you please comment on this?

Also, can you suggest good books on creating VFP Web-enabled applications for those who have never done it before? (I had a chance to write desktop applications only so far.)

Thanks.
Stella.
 
Stella,

Go visit and read as many of Rick Strahl's whitepapers as possible. Rick also has software that makes it relatively easy to connect your VFP applications to the web. All Rick's software is available in a free evaluation edition for you to use and study to see if it meets your needs.

Another product to look at is FoxWeb ( which is also available in an evaluation edition.

Both these websites have active user communities on the web that you can post questions to.

Good luck!

Malcolm
 

Thanks for the links, Malcolm!
Will go and read.

So, as I understood from your reply, we will need additional products/tools, besides FoxPro, to connect. Right?

I guess what I would like to understand now is whether it is possible to run/display reports right on the web, from the FoxPro app, with or without the use of additional tools, or it is still necessary to convert them to some other format?

Does VFP9 provide some new good tools for Web applications and, in particular, for reports on the Web?

Thanks.

 
Stella,

You will need other tools to run VFP reports from the web. You will also need to convert your report output to PDF or HTM so your users can view it.

VFP 9 has a ton (TON!) of new report capabilities but no links directly to the web. However you may be able to convert many reports to an HTML format and have a separate web application post these files on the web.

I recommend reading the community/user forums on and to see how people are implementing solutions like you want to build.

Malcolm
 
we have recently started to support our website with foxpro, and using the following tools:

- iis 6 webserver
- foxisapi , a dll which produces 3 parameters from the
user on the web and asks from vfp a html string back to
publish
- vfp to produce com servers (dll or exe) to handle the 3 parameters from the foxisapi and to produce a nice html string to give back to foxisapi
- frontpage for the graphical things

to give u some idea (read rick strahls internet applications for more ideas and work out)

 

Thanks for your responses, guys. Now I have a starting point to learn more (and might get a VFP9 upgrade, too).

Stella
 
Hi,

I have 2 question:

I made a form and now i want to login in a web site:
1. how can i made automaticaly login (user and pass)
2. how can i parse a html file from a site?



 
Lavale,

Go to and read Rick Strahl's whitepapers. They will explain how to do what you want and will include code as well. Rick has an active user forum on his site as well. You can also post your questions there as well.

Malcolm
 
I use FoxWeb. Very easy to use. enbed html and foxpro together.

Almost similar to JSP where you put the scripts of jsp within the tags <%>, except it is foxpro codes.

I tried to use west-wind.. but, I got stuck many places and it seemed more complicated to me.

that's just my opinion.

Ali Koumaiha
Wireless Toyz
Farmington Hills, Michigan
 
Ali,

I would like to add to your endorsement of Foxweb. I've used Foxweb on several projects and found the product worked great, and that the support and online documentation were excellent.

The reason I recommended West-Wind to the original poster (Stella740pl) was her emphasis on reporting and PDF. Rick Strahl has some whitepapers and code that address these 2 challenges very well including how to build solutions for asynchronous web requests like reporting.

The reason I recommended West-Wind to the 2nd poster (Lavale) was that this person had client side needs. Foxweb only addresses server side functionality.

So, in conclusion, Foxweb is an excellent product and well worth looking at. Even if you go with Foxweb, Rick Strahl's free whitepapers on web development and VFP are worth reading anyway.

Malcolm
 
10x, i will try with foxweb. But i put this questions because in fox (i made web class = "web") and exist "parse" function.
thisform.web.navigate(cnamesite) = open site in browser
but,

thisform.web.cparsefileext it's not working.

Maybe someone from can explain were it's mistake.


 
Lavale,

Make sure you've read the following article:

Rick Strahl: Using the Shell API and Internet Explorer Components with VFP 08/07/2003

The webbrowser control has many quirks. One of the things you will need to do is make sure that the control has both finished loading the content and rendering it, otherwise properties that you expect to exist won't exist yet and will throw an error. Rick's paper above shows you how to get this stuff done.

Malcolm
 
Stella,

You said another person takes tables and reports produced by my VFP6 desktop application, and converts them to SQL Server and PDF files respectively, to use them in his Web application (not VFP).

I think this should be central to your solution: There shouldn't be a need to convert VFP files to Sql Server, since SQL Server doesn't provide any more Web-access than VFP (less even, really).

The key is: what does this other person use to access SQL Server? Whether ODBC or ADO, he should be able to use VFP ODBC or ADO providers instead, and get straight to the VFP data, and still produce the web pages and PDFs in the same manner.

I would think that this is the most direct way to get the VFP data on the web with no conversions (rather than re-implementing everything you have again in another language/platform).

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
See faq184-2143 which describes one method to create PDFs from within VFP. There are several generic PDF makers,some shareware, some free. I use similar logic to create my online reports as PDFS. That way I can put a simple link to the PDF file on my web page for the user to click. Avoid hard coding in HTML, let the programs do all that grunt work.

By the way, get VFP 9. Not only does it have numerous enhancements, but VFP 9 is more stable as well. VFP 6 COM-compliant EXEs throw weird errors sometimes when called from ASP. We get occasional errors where a table is opened and some fields are read, then out of the blue on the next line it says it can't find the alias of the open table! See thread1253-812213. Visual FoxPro 9 rocks!

dbMark

 

Thanks, Bill and dbMark, and everyone else, for the pointers.

Bill, I asked, he uses ODBC with ASP. The manager says he tried to connect to DBF some long time ago, but experienced problems of some kind, and everyone already forgot what was the nature of the problems, so they decided to go with conversion to SQL Server back than (I guess, because he is more comfortable with it), and still doing that.

I showed your response to the manager. He is willing to try again with VFP tables, so I got a non-urgent assignment to do a research (in my spare from regular responsibilities time), and report back with details, on how to do it with VFP, what to use, what to be aware of, and what problems could arise.

dbMark, I would be glad to get VFP9. It's not totally up to me, though. Gladly, in the light of all the information I've got with your help, we might be heading in that direction reasonably fast.

Thanks!


 
Okay, this is a great advancement.

He/you can use ODBC to VFP with ASP... the newer VFP ODBC drivers are much better than the older ones and probably already fixed whatever problem he was having.

If he does any SQL Pass-Through (passing literal SELECT, INSERT and UPDATE statements through ODBC to the backend) he may have been simply stumbling on the slight SQL syntax differences between VFP and SQL server.

However, a completely different approach would be for you to create a VFP COM server (not hard) and for the ASP to access that COM server. This really isn't the best way to get to VFP data, but it could be used to automate the transfer from VFP to SQL Server (to be sure to have fresh data), or to automate a "Print Report to PDF driver" to create on-the-fly PDF's.

I had't been addressing the reporting issue at all... some good ideas have been presented for this portion....

Is there a reason PDF's are needed instead of simple HTML generation? There are 3rd party tools, too, (like Frx2Any) that take VFP reports and generate them directly to HTML and/or PDF. I know you don't want to always be saying "If we want to use VFP we have to buy THIS, too..." to management, but if your current method is manually using Acrobat to "Print" the VFP reports to PDF format, then you will probably have to buy Something to eliminate that manual step.

Here are some more links for your perusal regarding creating PDF's from VFP:


- Bill

Get the best answers to your questions -- See FAQ481-4875.
 

Thanks a lot, Bill,

Took a quick look at everything, saved in Favorites, will read through whenever I have some slack time. Looks great.

Is there a reason PDF's are needed instead of simple HTML generation?
Probably not, but cannot say for sure right now. Will see.

This really isn't the best way to get to VFP data, but it could be used to automate the transfer from VFP to SQL Server
Actually, there is no a real reason to convert tables from VFP to SQL Server, besides those ODBC troubles that I mentioned above. The tables used on the web are not extremely big, and there are no strong security concerns, so as long as DBFs can be conveniently accessed from the web, they should satisfy most needs.

I have a possibly silly question. You say, the newer VFP ODBC drivers are much better than the older ones. Are they provided as a part of VFP, or need to be bought/downloaded, etc. separately?

And another one. Some of our tables are converted to type FOX2X at the end of the process, so they could be open in Excel by some of the users who require that, and still be DBF for other needs (like SQL SELECTs). Could that be (or have been) a problem in accessing them through ODBC, compatibility, or cause other issues? Should I have 2 copies in 2 different formats, old FoxPro and VFP, to satisfy all the needs?

Thanks.
Stella

 
Some of our tables are converted to type FOX2X at the end of the process, so they could be open in Excel by some of the users who require that, and still be DBF for other needs (like SQL SELECTs). Could that be (or have been) a problem in accessing them through ODBC, compatibility, or cause other issues? Should I have 2 copies in 2 different formats, old FoxPro and VFP, to satisfy all the needs?

I'm not very conversant with the VFP ODBC drivers... I hope someone else will answer more definitively. From what I remember, you can access VFP data in two ways through ODBC, depending on which driver name you choose.

One driver name expects you to open a DBC (database container) and automatically provides access to all the tables/views/etc referenced by that DBC. Converting .DBFs to FOX2X would "distance" them from the DBC (I almost said "remove", but the COPY TO operation won't affect the original table at all...), so the first ODBC driver may not work with the resulting DBF's.

The other driver name expects free tables (independant DBFs) to be selected and shouldn't care whether they are in FOX2x format or a newer format, up to the version of the ODBC driver (ie. don't try to use a VFP7 ODBC driver if the DBFs are created by VFP8 or 9). With this driver, only one table can be accessed with a single ODBC connection (I think).


- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top