Open a DB automatically with right settings by command line

mimie0309mimie0309 Member Posts: 3
Hello,
I'm developping a database explorer for Nav users with nav2009 which contains all the customer databases.
The purpose is that when the user selects a DB to open, this one is automatically opened with the appropriate version and parameters
For that, I want to pass in a command line: The DB version, the licence file, the SQLServer Name, and the DB name (the Database is a SQL DB )

I tried the SHELL function, but it doesn't give the right result:
SHELL
('C:\Program Files\Microsoft Dynamics NAV\60\Classic\finsql.exe','SERVERNAME=OXIA-0942FC5B8B','DATABASE=Demo Database NAV (6-0)');
This synthax runs Nav Client but, on the server connection window it's written all this string: SERVERNAME=OXIA-0942FC5B8B','DATABASE=Demo Database NAV (6-0)

Can I obtain a help for this matter!
Thx

Comments

  • kinekine Member Posts: 12,562
    If you are connecting to NAV DB server, you use only the Server name. If you are connecting to the fdb file directly (single-user mode), you use only the database file name. I never was in situation when I used both (not talking about SQL option).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • mimie0309mimie0309 Member Posts: 3
    The case is that's an sql database, and the server is the sql server
    I don't know if I can pass the informations of : (SQL) SERVERNAME, licence file, and the DATABASENAME in a command line to open the database automatically.
  • kinekine Member Posts: 12,562
    To open the database fully you need to include company name in the command. But, you cannot set which license will NAV use. There is no parameter for that.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    kine wrote:
    If you are connecting to NAV DB server, you use only the Server name. If you are connecting to the fdb file directly (single-user mode), you use only the database file name. I never was in situation when I used both (not talking about SQL option).

    Its quite common (back in native days) to start the server with the parameter DATABASE='' this means that no database is assigned, and you need to assign the database at the client. Of course you cant use F6 because its on a different machine, but its common to put hte server name and database name as parameters on t he command line.
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    kine wrote:
    ... But, you cannot set which license will NAV use. There is no parameter for that.

    Another very useful Navision feature that they removed. I can't even remember which version it was that they removed that. It used to be very useful when you needed to switch between developer and customer licenses.
    David Singleton
Sign In or Register to comment.