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.
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I would love to be able to implement this type of feature, however I am dealing with small businesses with at most 15 people (so far) and no on-site IT staff that could setup the server and ports. As it is, we have about 1/2 of our clients using an XP workstation as a file server. I'm not looking forward to explaining to people how to install SQL Express and opening ports and starting services just to be able to connect in this environment.

Part of this is related to the installation.  We have a VERY sophisticated install so that there doens't have to be IT people to install SQL Server, etc.  This is all done through the installation, including the installation of the service, ports, etc.  The more sophisticated you make the install, the less sophisticated the end-user has to be to install the product.  We have spent a TON of time here...but it has paid off in the end.

In this example, it doesn't have to be a server OS...we have users that use XP and peer to peer as well.  We just have our own Server service that runs (on any Windows platform).  Just some ideas Smile

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