RouteX Document Router Toolkit
Main Functions Types & Errors Query Language Demo Home

 

Creates a database of queries for routing. Before you can use RouteX you must create a database for RouteX to store its queries. After you create the database you then must open it up. You can have mulitple databases but each RouteX object will work with only one database at a time. Creating a database does not open it. You must explicitly open a newly created database.

Two files will be stored in the location you specify. The main one, give by your name, stores the data for each query. An associated file that is created upon demand is an index of the query data which is used to speed searches. This index file has the extension ".qdx" and should not be deleted.

When creating the database you must also specify the record size. The record size is the maxium amount of data that each query can contain. This includes the search query itself, the title, the reference and the action. This size is used to speed up searches and optomize the database. If you will be storing little data with each query we suggest you choose a value like 400. If you are storing quite a bit of information in these fields then you should make this equal to the largest number of bytes you will be storing plus 20.

Datalength = bytes in largest search query + bytes in largest reference field + bytes in largest title + bytes in largest action + 20

Rember that search queries are stores as hexadecimal strings which are at least twice as long as regular ASCII search queries when converted.

Synopsis

void rxCreateRouterDatabase( RouteX Router, char *FileName, size_t DataLength, StatusCodeT *Status )

Arguments

Router The RouteX object you are deleting
FileName The name and path of the database you wish to create.
DataLength The length in bytes of the largest query record you will create.
Status A pointer to a value of type StatusCodeT. If an error occurs during the execution of the function a value representing the error will be stored in *Status. You should check *Status after every function call.

Returns

Nothing.

Related Functions

rxOpenRouterDatabase, rxCloseRouterDatabase

Example

StatusCodeT  Status;

RouterX      Router;



Router = ixCreateRouter( 0x0011FFFFL, 0x0011FFFFL, &Status );



if ( *Status < 0 ) {

   printerror( Status );

   return; // error

}



// Check to see if we created a database yet

if ( DoesntExist("d:\routing\queries.rdb") ) {  



   // if there isn't a database, create it

   rxCreateRouterDatabase( Router, "d:\routing\queries.rdb", 1000, Status);



   if ( *Status < 0 ) {

      printerror( Status );

      return; // error

   }

}



rxOpenRouterDatabase( Router, "d:\routing\queries.rdb", 1000, Status);



if ( *Status < 0 ) {

   printerror( Status );

   return; // error

}



// 

// rest of program using RouteX goes here

//

 

Previous Main Next Home

Copyright 2000 Lextek International