connect to mssql from batch script

Posted by JPro on Stack Overflow See other posts from Stack Overflow or by JPro
Published on 2010-04-30T09:49:00Z Indexed on 2010/04/30 9:57 UTC
Read the original article Hit count: 356

Filed under:
|
|

Hi,

I am supplying a batch script to create a DSN connection in the user computer before they start to use my application. I am using this in a .bat file.

ODBCConf ConfigSysDSN "SQL Server" "DSN=CONNAME|SERVER=PCNAME\INSTANCENAME

But I want to make sure they will be able to connect to the database, considering the fact that proper drivers may not be installed in their systems. So, is there any way to check the connection from the same batch file and inform the user if something unable to connect to the database?

thanks.

© Stack Overflow or respective owner

Related posts about mssql

Related posts about batch-file