Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 DSN Creation

Author  Topic 

natishkc
Starting Member

29 Posts

Posted - 2009-10-08 : 05:02:48
Hi Giants,

Is it possibble to make a batch file to conect the sql server with secure sa through DSN???




Natish

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2009-10-08 : 06:08:25
Hm...not sure about .bat-file but you can for sure use a .vbs-file

somefile.vbs:
Set Conn = CreateObject("ADODB.Connection")
Conn.open "DSNname"
...


- Lumbago
http://xkcd.com/327/
Go to Top of Page

natishkc
Starting Member

29 Posts

Posted - 2009-10-08 : 06:15:50
Sir,

Will u please explain in detail as I am new to this.


Natish
Go to Top of Page

natishkc
Starting Member

29 Posts

Posted - 2009-10-08 : 06:17:37
Will the following script will work?


odbcconf.exe /a {CONFIGSYSDSN "SQL Server" "DSN=DSNNAME|Description=description|SERVER=yourservername|loginid=yourUID|password=yourpassword"}

Natish
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2009-10-08 : 06:35:48
Check this link to create a .vbs-file: http://www.rgagnon.com/wshdetails/wsh-0011.html

To create the DSN I always just used the wizard in windows...

- Lumbago
http://xkcd.com/327/
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2009-10-08 : 06:37:02
...or this: http://www.vbexplorer.com/VBExplorer/vb_feature/june2000/Database_Beginner_ADO_DAO.asp

- Lumbago
http://xkcd.com/327/
Go to Top of Page

natishkc
Starting Member

29 Posts

Posted - 2009-10-08 : 06:39:48
Thanks Sir,


It works. Nice ending

Natish
Go to Top of Page
   

- Advertisement -