Monday, February 20, 2012

RAS error no 756

RAS error no 756

If i m trying to connect my remote server from the dos prompt
by giving the foll syntax ie

rasdial <connection> <user> <password>

its getting connected to my remote server.
but i m facing a problem while i m giving the syntax in qa

xp_cmdshell 'rasdial <connection> <user> <password>'

error detail i m getting is

'Remote Access error 756 - This connection is already being dialed.'
even though there is no connection existing.

could u pl let me know what could be the reason.

On the other side
If i m trying to disconnect after a manual connect from the query analyzer
its working fine ie

xp_cmdshell 'connectionname/disconnect'

immidiatly after this , if i m trying to connect through qa i m getting
the same error no ie 756.
even though there is no connection existing.

is there any command or syntax to know through qa
if there is any existing connection disconnect (RAS Connection) ?In your place, I would be inclined to modularize the approach more (at least to identify your issues, as RAS has been changed between different OS and service packs).

In other words, rather than:

xp_cmdshell 'rasdial <connection> <user> <password>'
xp_cmdshell 'connectionname/disconnect'

Implement something like:

xp_cmdshell 'c:\MyConnectBatchFile.cmd'
xp_cmdshell 'c:\MyDisconnectBatchFile.cmd'

That should allow you to manipulate your OS commands separately. Once you have the OS components operating as desired for your requirements, you can look at imbedding everything directly into the xp_cmdshell execution string again.|||Thanx for the mail.

MyConnectBatchFile.cmd how to use this command can u pl explain me better.

I m using win-2k server.

xp_cmdshell 'c:\MyConnectBatchFile.cmd'
xp_cmdshell 'c:\MyDisconnectBatchFile.cmd'|||Originally posted by ranjan
Thanx for the mail.

Q1 MyConnectBatchFile.cmd how to use this command can u pl explain me better.

I m using win-2k server.

xp_cmdshell 'c:\MyConnectBatchFile.cmd'
xp_cmdshell 'c:\MyDisconnectBatchFile.cmd'

A1 Yes, I think so (see below, later).

Use Notepad to create a new text file. Copy and paste (or retype) everything normally typed into a "DOSprompt command line window" into the text file. Rename the file something like 'c:\MyConnectBatchFile.cmd'.

Verify that the MyConnectBatchFile.cmd functions correctly (as you expect) by running it interactively (double clicking on it).

Note: A pause or other interactive dos command left in a .cmd file (for testing, etc.) will cause exec xp_cmdshell 'c:\MyConnectBatchFile.cmd' to appear to 'hang'. It will never get input to continue, and the process will then have to be killed (in taskmanager)!!

Once MyConnectBatchFile.cmd functions as expected interactively; call it from QA, using xp_cmdshell. For example:
exec xp_cmdshell 'c:\MyConnectBatchFile.cmd'

No comments:

Post a Comment