Connect to SQL server from batch file

Susja 716 Reputation points
2020-08-31T15:35:53.83+00:00

Hello,
I have a batch file that I use to start application from Win 7 client. It will connect to remote SQL Server and start application.
It looks like this
pushd \<server>\MITRE\SoftwareReleases\v23-lfhm
cmd /c start LaminarFlowHoodModule.exe
Note: at the location I have configuration file LaminarFlowHoodModule.config with the name of database, creds and etc. It does not state which driver to use. I assume that it is coded inside LaminarFlowHoodModule.exe
This is the section from LaminarFlowHoodModule.config

<!-- Database settings -->
    <add key="DataSource" value="server" />
    <add key="InitialCatalog" value="database" />
    <add key="TrustedConnection" value="false" />
    <!-- Username/password required if TrustedConnection is false -->
    <add key="UserName" value="user" />
    <add key="Password" value="password/>

Recently it stopped working and it failed to connect to database.
I installed latest SQL Server Native client driver and was able to create ODBC connection e.g. 'connection1' and then connect to database with no problem.
Hence, my question:
Could I create another batch file of modify existing one in order to force LaminarFlowHoodModule.exe to use ''connection1' ?
Thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,634 questions
{count} votes

8 answers

Sort by: Most helpful
  1. m 4,271 Reputation points
    2020-09-02T07:26:43.967+00:00
    0 comments No comments

  2. Susja 716 Reputation points
    2020-09-04T10:57:30.43+00:00

    Folks,
    I just realized that the issue I'm having with connection is caused by the change our IT did in Group policy for Win 7 for security reason.
    Based on that I assume that all my attempts to fix it using some workarounds would be useless.
    I am still confused why connection using ODBC works fine … How this type of connection could 'disregard' Group policy.
    Anyway … do you think I should stop these efforts and simply replace Win7 for Win 10?
    Thanks


  3. Susja 716 Reputation points
    2020-09-08T00:15:44.703+00:00

    Hi Folks,
    I am already in a process of buying / replacing Win7 with Win10.
    Meanwhile IT has changed their hypothesis about change in GP and currently they suggest it's due to some on Microsoft update patch.
    They are still investigating …
    Thanks

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.