PDA

View Full Version : SQL Server Function Declarations



jonathanqis
10-04-2011, 11:11 AM
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.

DebbieL
10-05-2011, 09:13 AM
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 (http://helpnet.flexerasoftware.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield18helplib/ISQLCustomize.htm).

I hope that helps.

jonathanqis
10-07-2011, 06:28 AM
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 ?

hidenori
10-10-2011, 12:35 AM
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.

jonathanqis
10-11-2011, 11:39 AM
Thanks

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