Home All Groups Group Topic Archive Search About

database selection in deployment

Author
6 Nov 2006 11:04 PM
Leanne
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

Author
7 Nov 2006 12:08 PM
Robinson
"Leanne" <leann***@connectretail.com.au> wrote in message
news:1162854296.337940.316470@b28g2000cwb.googlegroups.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