cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jonathanqis
Level 6

SQL Server Function Declarations

I am trying to modify the results returned from the SQLBrowse/SQLBrowse2 function.
I am trying to use SQLRTGetBrowseOption and SQLRTSetBrowseOption functions in an InstallScript MSI project .rul file.
The compiler reports both as undefined.

I have already included the line:
#include "ifx.h"
If I include the SQLRT.h file anywhere in my script it complains about duplicate definitions, but this header seems to be the one containing the function declarations.

My call to SQLRTInitialize2(); on the lines preceding the undefined functions works perfectly well.

Q. How do I add support for the two functions in an InstallScript MSI project?

Thank you in advance.
Labels (1)
0 Kudos
(4) Replies
DebbieL
Level 17

The InstallScript functions SQLRTGetBrowseOption and SQLRTSetBrowseOption are applicable to InstallScript projects. They are not supported in InstallScript MSI projects.

For an InstallScript MSI project, I think you may need to set Windows Installer properties such as IS_SQLSERVER_LOCAL_ONLY or IS_SQLSERVER_REMOTE_ONLY, depending on your requirements. For more information, see Overriding the Default SQL Run-Time Behavior.

I hope that helps.
0 Kudos
jonathanqis
Level 6

I read the link you included and it sounds like you should be able to set them.
However when i go to the connections advanced tab there are only 5 properties to set and none of them are the two you mentioned.

I suspect I'm not understanding the tabs functionality but I'm stuck !

I also have two question on this.

I tried a more comprehensive way to customise the behavior by using DefineDialog and editing the handler code for the server list creation.
Specifically:

SQLRTGetServers2( szConnection, TRUE );

Which I believe lists only local servers.
However, I got a list of two, one of the servers is on another pc on the same domain as I am.

Q. What is meant by LOCAL when refering to SQL server instances listed in this dialog ?

Q. What I am trying to achieve is to list only SQL Servers present on the PC the software is being installed on.
Is there a better way to do this ?
0 Kudos
hidenori
Level 17

You can simply call the MsiSetProperty InstallScript function to specify the IS_SQLSERVER_LOCAL_ONLY property as follows:

MsiSetProperty(hMSI, "IS_SQLSERVER_LOCAL_ONLY", "1");

When the IS_SQLSERVER_LOCAL_ONLY property is specified, the SQLBrowse dialog lists the SQL server instances present, as well as SQL server instances registered for DSNs on the PC the software is being installed on.

The SQL server instances registered for DSNs may include remote instances. If you want to list only SQL Servers present on the PC the software is being installed on, you need to write code to remove them from the list returned by the SQLRTGetServers2 function.
0 Kudos
jonathanqis
Level 6

Thanks

This leads me to a question I had a while back but i'll start a new thred for that.
0 Kudos