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

Two SQLBrowse buttons on SQLLogin Dialog

Hello-

Within my application, we use two databases all on the same server which will be accessed by the same username/password. Therefore, on the SQLLogin page, I wanted to add a new TextBox and enable the user to Browse to each of the databases. So, I created a new button with the following Behavior:

[IS_SQLSERVER_LIST] [IS_SQLSERVER_DASHBOARD_DATABASE] 1
[IS_SQL_DB_BROWSE] 1 1
[IS_SQL_SERVER_BROWSE] 0 1
[IS_SQLBROWSE_INTRO] [IS_SQLBROWSE_INTRO_DB] 1
DoAction ISSQLQueryDatabases 1
SpawnDialog SQLBrowse IS_SQLSERVER_STATUS=0

This is the exact same as the default Browse button except for the first line, the default has IS_SQLSERVER_DATABASE. I would think by putting a new property in this first line, the SQLBrowse dialog would save the selected database to that property and populate my text box that is bound to that property on the form. But, it does not. Whenever I select OK, it populates the original default text box and property. Is there anything I can do? Can I add two Browse buttons on my SQLLogin page each pointing to a different property?

Thanks,

Drew
Labels (1)
0 Kudos
(6) Replies
hidenori
Level 17

That is because the SQLBrowse dialog sets the selected database back to the IS_SQLSERVER_DATABASE property. You need to have the following control events in order to accomplish your requirements:

For the original database browse button on the SQLLogin dialog:
[IS_SQLSERVER_LIST] [IS_SQLSERVER_DATABASE] 1
[IS_SQL_DB_BROWSE] IS_SQLSERVER_DATABASE 1
[IS_SQL_SERVER_BROWSE] 0 1
[IS_SQLBROWSE_INTRO] [IS_SQLBROWSE_INTRO_DB] 1
DoAction ISSQLQueryDatabases 1
SpawnDialog SQLBrowse IS_SQLSERVER_STATUS=0

For the second database browse button on the SQLLogin dialog:
[IS_SQLSERVER_LIST] [IS_SQLSERVER_DASHBOARD_DATABASE] 1
[IS_SQL_DB_BROWSE] IS_SQLSERVER_DASHBOARD_DATABASE 1
[IS_SQL_SERVER_BROWSE] 0 1
[IS_SQLBROWSE_INTRO] [IS_SQLBROWSE_INTRO_DB] 1
DoAction ISSQLQueryDatabases 1
SpawnDialog SQLBrowse IS_SQLSERVER_STATUS=0

For the OK button on the SQLBrowse dialog:
[IS_SQLSERVER_SERVER] [IS_SQLSERVER_LIST] IS_SQL_SERVER_BROWSE=1
[IS_SQLSERVER_DATABASE] [IS_SQLSERVER_LIST] IS_SQL_DB_BROWSE=IS_SQLSERVER_DATABASE
[IS_SQLSERVER_DASHBOARD_DATABASE] [IS_SQLSERVER_LIST] IS_SQL_DB_BROWSE=IS_SQLSERVER_DASHBOARD_DATABASE
EndDialog Return 1
0 Kudos
alaytin
Level 3

Thank you very much for the response. This worked so that the database I select is set to the new text box. However, it looks to be setting both the IS_SQLSERVER_DATABASE and the IS_SQLSERVER_DASHBOARD_DATABASE to the value I select using either button. So, I select a database from the first SQLBrowse dialog and it populates both the text boxes.

The text boxes are pointed to different properties (one to IS_SQLSERVER_DATABASE and the other to IS_SQLSERVER_DASHBOARD_DATABASE) and per your response below, the within the pushbutton's events I have set

[IS_SQL_DB_BROWSE] [IS_SQLSERVER_DASHBOARD_DATABASE] 1
and
[IS_SQL_DB_BROWSE] [IS_SQLSERVER_DATABASE] 1

So, I am confused why it is setting both properties.

Thanks again,

Drew
0 Kudos
alaytin
Level 3

It looks I misspelled a property on my second dialog. Thanks again for your help.

Drew
0 Kudos
hidenori
Level 17

Actually, you need to set the name (not value) of the properties associated with the edit field to the IS_SQL_DB_BROWSE property so that the SQLBrowse dialog will set the selected item back to an appropriate edit field as expected when you click the OK button. Therefore, you should have the following entry:

[IS_SQL_DB_BROWSE] IS_SQLSERVER_DASHBOARD_DATABASE 1
and
[IS_SQL_DB_BROWSE] IS_SQLSERVER_DATABASE 1

INSTEAD OF

[IS_SQL_DB_BROWSE] [IS_SQLSERVER_DASHBOARD_DATABASE] 1
and
[IS_SQL_DB_BROWSE] [IS_SQLSERVER_DATABASE] 1

Also, please change the conditions in the SQLBrowse dialog as follows to get working properly:

From :
IS_SQL_DB_BROWSE=IS_SQLSERVER_DATABASE
To :
IS_SQL_DB_BROWSE="IS_SQLSERVER_DATABASE"

From :
IS_SQL_DB_BROWSE=IS_SQLSERVER_DASHBOARD_DATABASE
To :
IS_SQL_DB_BROWSE="IS_SQLSERVER_DASHBOARD_DATABASE"
0 Kudos
bornali
Level 5

Hi,

I have the same issue where i am trying to add another browse button to list the databases, so that i have two databases selected by the user from the same list of databases. I have the property name IS_LOGDBSERVER_DATABASE instead of IS_SQLSERVER_DASHBOARD_DATABASE
I have tried all the changes mentionned by hidenori.
I am using IS2009 pro.
For me it crashes when i browse( the created one) and select a db from the list, and press ok.
"Error 2812. The event IS_LOGDBSERVER_DATABASE is not recognized."

Anyone has any ideas?

thanks
0 Kudos
hidenori
Level 17

If you can send me a sample project that reproduces the behavior at hidenoriy@acresso.com, I will look into it.
0 Kudos