Subject Re: [ib-support] Could somebody pleeease help me??
Author Paul Schmidt
On 16 Apr 2002 at 16:05, Diego Gomez wrote:

> how can i know if an user uses only one database, and doesnt make
> another
> database with the same username, password and server name, and uses
> both of them in the same application?
> I would like to know how to recognize a database (instance) as the
> one an
> only the user can make, the only one than my application recognizes.
> By the way , my application is in Delphi 4, and im using interbase 5
> for
> the Database.

There is no way to prevent a really determined user, from being able to do this,
however here is an idea, store the server name and database path in the registry on
the users machine, now take the ASCII (or UNICODE) value of each character, and
do some "math" on those values, to come up with a key value, store that in the
registry as well. Each time the user logs in, you read the servername and path from
the registry, run the routine that came up with the key value earlier, and compare
them, if they are the same the application continues, if they are different, then give
the user some kind of message, such as suggesting a database problem.

If different users can have different databases, then you may wish to store separate
enteries for each user.


Paul Schmidt, President
Tricat Technologies