Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing .dbf stuctures
Message
From
14/11/2001 07:00:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/11/2001 09:49:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00580858
Message ID:
00581396
Views:
21
>I need to check the structure of a dbf so that a user can open a table if the structures is correct.
>
>The current code uses 2 criteria, the existence of a specific logical field and the total no of fields.
>
>In practice this works fine excepting that the table needs to be opened to perform the validation.
>
>lValidTable = .F. && Return value
>
>IF ASCAN(laTemp,[PROJECT_2]) > 0 AND ALEN(laTemp,1) = 20 && Check for logical field & total fields
> lValidTable = .T. && Return value
>ENDI
>
>If there any better way of doing this validation through examining the .dbf header file for example?
>
>TIA
>
>Dennis
Lparameters tcAlias1, tcAlias2
Local array arrTable1[1], arrTable2[1]
Local lnFields1, lnFields2,ix,jx
lnFields1 = afields(arrTable1, tcAlias1)
lnFields2 = afields(arrTable2, tcAlias2)
If lnFields1 # lnFields2 && Field count mismatch
  Return .f.
Endif
Asort(arrTable1)
Asort(arrTable2)
For ix=1 to lnFields1
  For jx=1 to 9 && Field related columns
    If arrTable1[ix,jx] # arrTable2[ix,jx] && Nonmatching item found
      Return .f.
    Endif
  Endfor
Endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform