Server List doesn't refresh anymore

MaximusMaximus Member Posts: 105
Hi there,

we have two SQL servers: Live and Test. When I switch between these servers using the Open Database dialog the list of available databases that pops up when you press the LookUp button in the Database Name field doesn't refresh but always shows the available databases on the server you currently connected to. I can log in when I type the name manually.

So I have to type in the Server Name manualy. Is it possible to change this?

And I also have to type in the Database Name manually. This is a new problem. What can cause this?

Thanks in advance.

Regards Max

Comments

  • KishormKishorm Member Posts: 921
    Funny you should mention this as I had to debug this very same issue recently. In my scenario the problem occurs if you have a form open which uses the "database" table - my form was using this to display the current database name on the form. In this scenario I get the same problem as you. As soon as you close the form containing the "database" table then the database list in the "file, database, open" works again. This to me is an issue with the NAV client and we have raised a support issue with Microsoft - waiting to hear from them.
  • MaximusMaximus Member Posts: 105
    Hi,

    tnx you triggered me.

    I recently added this code to Codeunit 1:

    CompanyOpen()
    IF GUIALLOWED THEN
    LogInStart;

    ShowDBName; //My line off code

    Function:

    ShowDBName()

    LRecDatabase.RESET;
    LRecDatabase.SETRANGE("My Database",TRUE);
    LRecDatabase.FINDFIRST;
    IF (STRPOS(LRecDatabase."Database Name",'ACC') > 0) OR
    (STRPOS(LRecDatabase."Database Name",'TEST') > 0 ) THEN
    MESSAGE('!!! ' + LRecDatabase."Database Name" + ' !!!');

    I removed the code and my problem is solved. Apparently the usage of the Database Table Record Variable causes the problem. I tried using a RESET and a CLEAR. But this doesn't solve my problem.

    I removed the code from C1.

    Regards Max
  • KishormKishorm Member Posts: 921
    Hi Max,

    You may be able to do a little workaround for your scenario - try moving the function into a separate codeunit (one which isn't single instance like CU1) and it may work. Worth a try anyway.

    Regards
    Kishor
Sign In or Register to comment.