October 23, 2002 at 9:37 am
I'm trying to open a VPN connection from a business partner SQLserver to our SQLserver
to run some storeprocedures from their server
allowing them to insert orders directly in our tables.
I want to create a job to
1-Open VPN connection
2-run SP
3-Close VPN connection
Anyone did it or can help ?
more info...
I'm stuck at the opening of the VPN connection , I used a batch file to open dial-up but can't find a way to simulate the <Enter> ...any other ways?
October 23, 2002 at 10:29 am
Pipe a file into it that contains the CR
myCon.bat < con.txt
where con.txt
username
password
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
http://www.amazon.co.uk/exec/obidos/ASIN/1904347088
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
October 23, 2002 at 3:03 pm
Hi for those that might have been interested by my post ...
Here is the solution i found,
In a StoreProc in SQL 2000 on Windows 2000
use
xp_cmdshell 'rasdial MyVPN MyUser MyPassword /phonebook:"C:\Documents and Settings\all users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"'
/* you might have to change the path depending if connection is CREATED for all users or Administrator or for only one user*/
--do stuff , call other SP
xp_cmdshell 'rasdial /disconnect'
October 23, 2002 at 3:06 pm
sorry , forgot use MASTER..xp_cmdshell
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply