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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filename lengths 1

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi,

I'm completely new to Paradox and wondered if (a) someone could tell me what the latest version of Paradox is and (b) the allowable length of filenames (including paths) in Paradox 5 and 7.

Your help would be much appreciated!

Clive :)
 
Also, how would I get access to the Paradox Version number of a table (using Delphi), at run-time
 
Clive,

Paradox v10.0 is the latest and is solely available as part of the Professional version of WordPerfect Office. Fortunately, the upgrade requirements are quite reasonable and it includes Paradox Runtime, which means you only need to buy a single item to be able to redistribute your database applications to other people/users.

As far as the allowable directory lengths and related limitations, many of the restrictions are based on the those of the operating system a given Paradox version was intended to support. For example, Paradox 5.0 supported Windows 3.x and is, as a result, limited to the restrictions of that operating system. It doesn't understand long file names, universal naming conventions (UNC's), or memory segments greater than 64KB.

Paradox 7 suffered from similar limitation, but those depended on the specific version of PAradox 7 you're using. For example, "Paradox 7 for Windows 3.1 and Windows for Workgroups" (aka Paradox 7.16) has many of the same restrictions as Paradox 5.0 because it was targeting the same versions of Windows. On the other hand, "Paradox 7 for Windows 95/NT" (aka Paradox 7.32) was compiled as a 32-bit application and was supposed to be able to support many of the new features of 32-bit Windows. It did have some bugs that were fixed in later patches and others that weren't fixed until later versions.

Perhaps more simply, older versions of Paradox may not be able to take advantage of new features added to the operating system. To fully enjoy the enhancements of a given version of Windows, you need a version of PAradox designed to support those features.

Paradox 10 is a fully 32-bit compatible version of Paradox, one that supports long file names, UNC paths, and other new abilities; however, there may be good reasons to restrict your use of these, for they may not be fully supported by other things in your specific configuration. For example, it took some time for Novell to completely support UNC paths.

In any event, the only documented limit ( for the length of directory names is a BDE limitation of 260 characters. I believe this is slightly greater than similar limits of certain Windows API calls, but can't recall the specific ones off the top of my head. I believe there are other limits within various features of different versions.

Directory aliases tend to make these limitations moot, for you can create use them to create shortcuts names for longer directory paths. I've never had a problem using directory aliases when a) I've used them consistently and b) placed all tables in an application in their own directory.

Now, as far as getting the version number (or level) of a given Paradox table from Paradox for Windows goes, you need something along these lines:

Code:
method pushButton(var eventInfo Event)
var
   strTable    String
   tcTable     TCursor
   intLevel    smallInt
endVar

const
   PROPSTBL = ":priv:tblprops"
endConst

   strTable = fldTable.Value
   if strTable = "" then
      msgStop( "Can't Display Properties",
               "Please enter the name (and path) of a table." )
   else
      if not isTable( strTable ) then
         msgStop( "Can't Display Properties",
                  strTable + " is not a valid table.  Try again." )
      else
         tcTable.open( strTable )
         tcTable.enumTableProperties( PROPSTBL )
         tcTable.close()
         tcTable.open( PROPSTBL )
         tcTable.locate( 2, "TableLevel" )
         msgInfo( "FYI",
                  strTable + " is a Level " +
                  string( tcTable.( 3 ) ) + " table." )
         tcTable.close()
         delete( PROPSTBL )
      endIf
   endIf

endMethod

Now, I realized you asked about how to do it from Delphi, but you know that there's a different forum for that, right?

In any event, there are a couple of ways to do it from Delphi, depending on the version of Delphi you're using and the way you're connecting to your Paradox data. Assuming you're using a recent version of Delphi and that that you're using the traditional method of getting to Paradox tables (e.g. TBDEDatasets), then something like this should work fine:

Code:
uses BDE;

function GetTableLevel(DBHandle: hdbiObj; var TableLevel: longint): word;
begin
  Result := 0;
  Check( DbiGetProp( hdbiObj( DBHandle ), curTableLevel, @TableLevel,
      sizeof(TableLevel), Result));
end;

procedure TForm1.Button1Click(Sender: TObject);
var
   liLevel : LongInt;
begin
   getTableLevel(  hdbiObj( Table1.Handle ), liLevel );
   showMessageFmt( '%s is a Level %u table.',
                   [  Table1.TableName, liLevel ] );
end;

Now, this is a quick-and-dirty, off-the-top-of-my-head example that can easily be improved. Nevertheless, it shows the basic technique. You'll note that in this implementation, it presumes that you have an active TBDEDataset connected to a Paradox table. In a production application, you'll probably want to add more error checking.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top