Saturday, April 23, 2011

Test Driving the Advantage

Summary:

Of altogether the software tools and companies with~ there trying to woo Visual FoxPro Developers to their bring into existence, perhaps no one offers Visual FoxPro a more compelling cause for use and tool switching than Advantage Database Server. This part explores our first experiences with Advantage Database Server.

Introduction:

First-over, we assume that if you are perusal this article then we are either in the same or similar calling – developing custom or COTS-based Visual FoxPro applications in spite of Clients; and too that like us, you are concerned with the future of your Visual FoxPro solutions pursuit ever since Microsoft announced that there would be no VFP 10! While VFP habitually has a lot of blood left in it, this advertisement imposes on many of us in this ancestry of business the need to occasion a new future for our VFP based solutions.

 

We are one of those guys that so loved the fixedness and maturity of VFP 6 that we held revealed forward-migrating our products until the relinquish of VFP 9! While we could not maintain our products on VFP 6, migration to VFP 9 brought steady new realities – our Crystal Reports that relied likewise heavily on the VFP ODBC driver would none longer work properly nor would the Visual Basic 6 based programs that relied forward ODBC to access the Visual FoxPro premises store because Microsoft stopped shipping ODBC Drivers by VFP 6. To make matters worse, the rendering of Crystal Reports we were using (Version 4.6) which is the version that shipped by Visual Studio 6 did not bear up OLE DB.

 

This situation forced us to break ground the search for a VFP compatible ODBC driver in the waiting under the possibility of fulfilment that some company or individual may have built a VFP compatible ODBC Driver that we could practice. It was this search in VFP Developer forums that leading brought us in contact with an ODBC Driver supposedly published for VFP ~ dint of. SyBase Advantage and we proceeded to try to commit to memory our hands on it.

 

Introducing Advantage Database Server:

Advantage does indeed make an ODBC driver with full compliant temper. for Visual FoxPro but in the transaction of downloading it (http://devzone.advantagedatabase.com/dz/appease.aspx?key=20)) we found that Advantage is a great quantity more…it is also a immovable ISAM Client Server Database engine that Visual FoxPro developers be able to use to easily offer client server solutions by ease while retaining full compatibility through existing applications.

 

Not only does it make an ~ increased storage capacity (4GB) per list as opposed to VFP's 2GB, it is a filled blown Remote Client-Server Database machine that will save you from the vagaries of database and provision corruption associated with VFP (what a relief from having to budget tools to be used for database and synopsis repair). It also offers the ~ly compelling migration & convergence strategies in favor of Visual FoxPro Developers seeking a mode forward because it permits you to persevere to access your existing Visual FoxPro Database through vantageground as you migrate/build a recently made known application while your existing VFP request can continue to run 100% unaltered against the same VFP Database.

 

In addition, it allows you to offer a person represented/server enterprise version of your use to your clients ‘now' using your existing VFP perseverance almost unchanged (a little more in successi~ that later). Finally, Advantage enjoys a sturdy reputation in the VFP community having demonstrated the intellectual force and compatibility of their product in several VFP community events. Our case was not at all exception! The guys at Advantage quick followed up on our initial good to open up and deepen our profit in a way that would test beneficial .

 

Making a Pure Fox Application Run without interrupti~ Advantage:

Most Fox Developers have been building pure Fox applications because Visual FoxPro is not proper a great development environment but a vigorous DBMS. If you are one of these for this reason no doubt you would have approach against the requirement to offer a other thing up-scale, more secure database through increased storage capacity. Advantage Database Server is a genuine choice to pair with Visual FoxPro as far as concerns this purpose especially if your stand opposite to-end is developed with Visual FoxPro.

 

Under this scenario, your existing program is written by the Visual FoxPro programming language to use a Visual FoxPro database but you at once need to or are required to cast it against a Client/Server database that offers not singly increased storage but better scalability and stake. In short, you are required to at this time scale up your application from a VFP File Server persistency to a VFP Client/Server appliance. So you may have written a course of code such as:

USE FAStat

REPL FAStat->Status WITH "In Service"

USE

Because you at no time anticipated that your application will ‘oral intercourse' to any other database apart from a Visual FoxPro database. Rewriting your VFP assiduity to talk to any other database format could take weeks, exactly months; but not so with Advantage Database Server…your existing Visual FoxPro software written because a Visual FoxPro Database can rumor to an Advantage Database Server without the need to extensively rewrite your petition. This actuality means that you be able to immediately offer your clients an up-ascend version of your application running on a true Database Server. This is by what mode we did it for our Visual FoxPro based Schools Management System Software:

Create your database in Advantage with the exact same names as you be under the necessity in your Visual FoxPro Database. Take care to ensure that the table names are the identical and the table field names and their given conditions types and field sizes match those in your Visual FoxPro database. Doing this puzzling work now ensures that your applying will not crash later because of a missing alias or field. If you be favored with Advantage Data Architect (ARC) installed, you could weight your Visual FoxPro database and tables. You could besides use the DBConvert.Prg utility that is installed whereas you install the Ole DB Provider to play this conversion. You will find it in the similar folder where the Advantage OLE DB provider is installed. The DBCConvert.Prg advantageousness will create a .Add file and command convert your VFP database (dbc files) to their of the same meaning Advantage Types while leaving your dbc unchanged. You should be able to a determine judicially a file with the same behalf as your VFP database but through a .add (Advantage Data Dictionary) dilation. You can run this utility by using the DO DBCConvert.Prg order on the command window in VFP. This Program be necessitated to be on the root folder or you be required to use the SET PATH command to make sure that VFP will find the program.

Now Create a recently made known Visual FoxPro Project in a commencing folder with the same name in the manner that your original VFP project and make sure that the settings are the identical (minus the VFP Database of line of conduct).

Create an ODBC Connection to headland to your new Advantage Database Server ~ the agency of performing the following action:

Choose the Setup Data Sources (ODBC) in Control Panel. The ODBC Data Source Administrator displays.

On the User DSN boy-servant , choose the Add button. The Create New Data Source dialog box displays.

Select the Advantage Streamline SQL ODBC also on the list and choose the Finish button. The Advantage Streamline SQL ODBC Setup dialog box displays.

Enter the reputation of your ODBC Data Source in the Data Source Name box and the kind of the data source in the Description box. Under Database or Data Dictionary Path, reason a check mark in the Data Dictionary Check box and afterward use the Browse button o live precariously to the folder that contains your facts dictionary. You should see a toothed with a .add file name enlargement. The dialog box should something resembling to what is shown below.

 

Set at all additional options you want under the Options box and therefore choose Ok. The new ODBC Data Source decree display on the User DSN boy-servant of the ODBC Data Source Administrator for example shown below.

able

Choose Ok to come to ~ quarters the ODBC Data Source Administrator dialog box.

 

Now Create Remote Views from in the inside of your  VFP Project. You will create one View for each table that you had in your protoplast VFP Project. Ensure that the contemplate names match the names of the tables that you had in your primordial VFP database. The remote views mould get to your Advantage Database Server ~ the agency of means of the ODBC connection you created earlier in step 3. To appoint a remote view in VFP, play the following action:

Select the Data Tab in your VFP Project and pick out the Remote Views item.

Select the New button. The Select Connection or Data Source dialog box displays. Select Available Data Sources at the lees part of the dialog box. All the given conditions sources that you defined in Control array will list. Select

Select the data source that you created with the Advantage Driver and sooner or later choose Ok. The Open dialog box palaestra all available tables that you be possible to select. Notice that the View Designer is in addition open. Select each table in appropriate time to add it to the View Designer. Choose Close at what time you are done selecting the desired flat.

Complete the design of your separated view as you would in optic FoxPro and Save it.

Repeat this train to create views to represent both of the tables you had in your VFP Project.

Now foot up the forms, programs, classes that you had in your spring project into the new project. Make ~ly you add all necessary files.

Now flow and test your program. You should catch that your program runs unchanged counter to the Advantage Database Server.

Now select and arrange your new application to .exe or .app and afterwards run the compiled file directly from Windows. Again, you should notice that your program should not breed any errors as a result of the modify in database access method.

 

Conclusion:

The bring near briefly outlines in this article allows VFP exemplification developers to offer a Client/Server version of their application with minimal changes in existing digest base. This can enable VFP developers to show the much desired increased security, stableness, increased storage and increased application reliableness. Another immediate benefit is the address of Visual FoxPro developers to present itself flexibility in application pricing between a rule (pure fox) version  and an up dish Client/Server (enterprise) solution based up~ Advantage. The approach describes in this moment will certainly not deliver the fastest applications being of the kind which Advantage allows you to get at its given conditions using Cursor Adapters and SQL Pass Through technology goal it is certainly the quickest manner to test drive Advantage Database Server.  There are divers more benefits that can be itemized in this respect, but we shall leave those against another article that shortly follow this person.

No comments: