By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

database selection in deployment

P: n/a
I created customized application to Microsoft POS system. I am now
working on the installation package. Any one knows how to get the local
sql database settings, and get user select database, so I can make
necessary changes to the database ( create new tables, update some
records etc.) to make my application work properly.

Thanks
Leanne

Nov 6 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Leanne" <le******@connectretail.com.auwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>I created customized application to Microsoft POS system. I am now
working on the installation package. Any one knows how to get the local
sql database settings, and get user select database, so I can make
necessary changes to the database ( create new tables, update some
records etc.) to make my application work properly.

Thanks
Leanne
Hi,

Microsoft POS uses MSDE 2000. You can query a given server for all
instances of SQL Server using a combination of registry enumeration (for
local instances) and SMO EnumerateAllSQLServers for remote servers. Once
your user has chosen a candidate (from a list), you can then enumerate all
databases on the server using the stored procedure "sp_Databases", allowing
the user to choose one. Alternatively you can setup a registry key with a
default server/instance and catalog name and read that when your application
starts, allowing the user to change it using the previously mentioned
enumeration methods to populate selection list boxes.

It's also sometime useful to have a default stored procedure to call to
check to see if the selected database is compatible with your application.
I use a "Version" stored procedure, that returns a version record that
returns a GUID along with other information, so I know whether or not I'm
dealing with a database related to my application, or some other database
that just happens to be attached to the SQL server instance I'm using.
Hope this helps,
Robin
Nov 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.