FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Working with ADO
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Working with ADO
Posted: Fri Feb 07, 2014 10:24 AM

Hello,

Building MDB data from dbf :

I have a system started in 1990 , +/- 70 dbf's , size +/- 134 Mbyte , in zip 14 Mbyte
CDX : +/- 20 Mbyte

Downloading and extracting to test on mine computer +/- 1 min 30
Also separate files can be downloaded

After converting to a mdb file : size 1.655.214.080 ( x 12 ) , zip : 39 Mbyte (building : 5 min)
Downloading and extracting seems not to be evident. I suppose that also the indexfiles must be included in the mdb-file

It is at least for me a reason to NOT make the conversion.

Am i wright ?

Frank

test
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Working with ADO
Posted: Fri Feb 07, 2014 03:22 PM

Frank

Sql databases like MS Access function different than .dbf and you have to approach the programming from a different point of view.

Sql databases do not have ( typical ) indexes .. you have to craft your select statements to only return the data you wish to work with. In Sql terms it is not beneficial to open an entire table ( full table scan ) including each and every field within that table.

With Sql you have the ability to only 'fetch' the rows and fields you wish to manipulate based on a conditional clause. With DBFCDX you typically open an entire table like this ..

Include "Ord.Ch"

Select 1
Use Customer via 'DBFCDX' Shared
Set Order to Tag State

cState := "SC"
Set Scope to cState
Seek cState

The above statement opens the entire table including all fields. With Sql you craft your Select statement to extract only the data you wish to manipulate like this ..

cSql := "Select [CustomerId],[Customer],[State] where [State] = 'SC' Order By [Customer]"

As you can see .. the approach to data manipulation is MUCH different and you have to 'let go' of your xBase data logic.

I have found MS Access to be a very good Sql database to start with as it is VERY ( physically ) portable and the ADO code is ( almost ) the same if you wish to port it to Sql Server or Oracle. The Basic ADO code remains the same .. only the Ole provider and connection strings change .. the code needs very little modifications between RDMS.

Ms Access like Ms Sql Server use native Ole providers that are present in every Windows OS since XP which means you can easily deploy your '32 bit' application without having to worry about any external setup's or run time client support.

There are other benefits using ADO with Access in that you do not have to worry about record locking or legacy 'opportunistic' problems that plague .dbf on Local area or peer to peer networks.

Another nice thing is that you can blend DBFCDX and ADO together in the same application. I like Sql for transactional data storage and manipulation, but I use DBFCDX all the time where I am creating reports and want to create external ( disposable ) temporary tables for reports.

There are many ADO expert friends here in the forum that will be glad to help you thru the process.

Rick Lipkin

Continue the discussion