cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sagarvt
Level 3

Read Sql Dialog

Hi,

I have to read sqlserver ip address,user id and password from Installshield dialog.

Can some one help me how to get the values data from sqlserver dialog box?

Regards,
sagar
Labels (1)
0 Kudos
(4) Replies
tpattison
Level 3

sagarvt wrote:
Hi,

I have to read sqlserver ip address,user id and password from Installshield dialog.

Can some one help me how to get the values data from sqlserver dialog box?

Regards,
sagar


You can retrieve those values from the Property Table using MsiGetProperty. The properties to check are IS_SQLSERVER_SERVER, IS_SQLSERVER_USERNAME, and IS_SQLSERVER_PASSWORD.

Here is some sample code


#include "ifx.h"

STRING strSQLServer, strSQLUser, strSQLPass;
NUMBER nvSize;

MsiGetProperty( ISMSI_HANDLE, "IS_SQLSERVER_SERVER", strSQLSRVR, nvSize );
MsiGetProperty( ISMSI_HANDLE, "IS_SQLSERVER_USERNAME", strSQLUser, nvSize );
MsiGetProperty( ISMSI_HANDLE, "IS_SQLSERVER_PASSWORD", strSQLPass, nvSize );


Hope this helps,
TP
0 Kudos
ayub_yousuf
Level 3

I also needed the same functionality i.e. getting the credentials from the SQL dialog and saving it into a config file. The code snippet u've provided is not compiling. Can u plz elaborate how to use it
Thnks in advance.
0 Kudos
yrjinstall
Level 2

I also needed the same functionality. But I would like to know how to do this in MSI project. My complete requirement is I need to get the server name and database name data from the user during installation and update the connection string in the registry and as well as in the supplied xml files.
0 Kudos
sagarvt
Level 3

ayub_yousuf wrote:
I also needed the same functionality i.e. getting the credentials from the SQL dialog and saving it into a config file. The code snippet u've provided is not compiling. Can u plz elaborate how to use it
Thnks in advance.


Hi,

USe OnSALLogin method from Installscript.
szServer,szUser,szPassword values gets automatically populated with values of server,user and password , after you enter the values in sql dialog box

save the details to ini file as
szSectionName = "sample";
szKeyName = "server";
inifile = "c:\test.ini";
AddProfString(inifile,szSectionName,"server",szServer);
AddProfString(inifile,szSectionName,"admin",szUser);
AddProfString(inifile,szSectionName,"password",szPassword);
0 Kudos