SQL Server Connection Query - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jusher
Posts: 195
Joined: Thu Dec 22, 2011 12:00 pm

SQL Server Connection Query

I have two dialogs: -
PrimaryServerDlg
SecondaryServerDlg
They prompt for: -
Server Name
DataBase Name
User Name
Password
In simple edit box controls I use this in a Custom SQL connection e.g.: -
Driver=SQL Server;Server=[SQL_PRIMARY_HOST];Port=1433;Uid=[SQL_PRIMARY_USERNAME];Pwd=[SQL_PRIMARY_PASSWORD];Database=[SQL_PRIMARY_DATABASE];

This works without a problem and I test can test the connection with the appropraite standard action on the next control.
What I want to do now is to change the edit controls to listbox controls and have dropdown lists of Servers and databases available. When I use the wizard for 'Browse SQL Servers' and 'Browse SQL Databases' it creates me 2 listboxes on the dialogue I specify. It also creates me the SQLConnectionDlg for login credentials I chose the Winsows API method. It attempts to get the SQL Servers but fails to login. I am using SQL Server 2008 R2. I am just typing in SQL Server as the ODBC resource.

Eventually I want to drop down the list grab the selection and assign it to a property i.e. The SQL_PRIMARY_HOST property as mentioned. Is this possible?

Regards,
John
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL Server Connection Query

Hi John,

Did you follow our related articles regarding this functionality?
http://www.advancedinstaller.com/user-g ... rvers.html
http://www.advancedinstaller.com/user-g ... bases.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jusher
Posts: 195
Joined: Thu Dec 22, 2011 12:00 pm

Re: SQL Server Connection Query

Yes I followed these links.

The SQL Sever on the machine is SQL Sever 2008 R2.

On the SQLConnectionDlg I type the following: -
ODBC Resource = SQL Server
Server Name = WRKSTN009
Port = 1433
Database = JU_BTS_DIR
Username = sa
Password

I have attached SQLServerBrowserListbox to a listbox control, using the browse SQL Servers wizard, on another dialog so just before this dialog is displayed it puts up a message box that it is browsing for SQL servers, it then tries the connection and fails. I have attached the database browser to another list box on teh same dialog but obviously ity is not getting that far.

are ODBC Resource and port correct above? The other bits are.

Regards,
John
jusher
Posts: 195
Joined: Thu Dec 22, 2011 12:00 pm

Re: SQL Server Connection Query

Had another think about this and just using the SQLConnectionDlg I created the listbox there and tried running the install using remote desktop from one of our domain servers. It listed the SQL servers. I tried on a number of flavours and all seemed to work: -

OS SQL Server
Windows Server 2008 2005
WIndows Server 2003 2000
Windows XP(SP3) SQL Server 2008 R1

My machine is not on the main domain I run remotely using Windows 7 , SQL Server 2008 R2, via Cisco ASA box. This I guess is the problem. However I have 3 SQL Server Instances on my local machine and this was not recognised. I ran the browser using SQL server login box <bowse for more> option. I checked that the SQL Server browser service was running. In both the Local Servers and Network Servers tabs the local servers appeared under the Database Engine tree.

Thoughts?

Regards,
John
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: SQL Server Connection Query

Hi John,

If you are using "ODBC Driver Manager" browse method you can also try "Windows Network Manager API" and see if it's more reliable.
Both methods may have some setbacks. These are listed in the "How to browse for SQL Servers on the network?" article I posted previously.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”