How to tell if connecting to valid DB


Author
Message
Crones
Crones
StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)
Group: Forum Members
Posts: 35, Visits: 345
I am curious to know how different people handle issues when connecting to databases that don't match your designed schema...



The scenario would be an end user connecting to some other database thinking that it is the correct one associated with my program, but is really another database that was installed for some other application.



I'm handing this by creating a DatabaseSettings table with 2 fields... SettingKey & SettingValue.

The DatabaseSettings table has a known number of records with specific SettingKey values I query for.



When testing the connection, if I get an object not found SQL Exception when querying the DatabaseSettings table, I know it's not my DB.

If that passes, I then fill the DatabaseSettings BO and check the count of records. If the number of records returned matches my known count, then I am "ASSUMING" this is my DB and perform version checks and so forth.



Is there a better way to handle this type of scenario? My end users are typically PC illiterate and don't necessarily have somebody technically competent to install and connect to an SQL Server for them...



Any advice or other ways to accomplish this is greatly appreciated.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search