Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help - Checking Connection with odbcping

0 views
Skip to first unread message

Ramesh Iyer

unread,
Jan 4, 1999, 3:00:00 AM1/4/99
to
I would like to set up a ODBC System DSN complete in all respects which
includes the server id, user id and password to connect to a remote server.

Is this possible ?

I am aware that the odbc admin interface does not allow you to create the
user id and password while defining the dsn.

Can this be directly entered into the registry (BTW, the client will be a NT
4 server) ? If so, How?

I need this setup so that I can perform odbcping's within sql scripts (using
xp_cmdshell) against remote servers to check the availability of the remote
system (odbcping -D <dsn>) to avoid hardcoding the userid and password
fields (breach of site security policy).

Is there an alternative ?

You can email any ideas to rames...@bigpond.com

Thanks in Advance.

Ramesh Iyer


Andrew Shugol

unread,
Jan 4, 1999, 3:00:00 AM1/4/99
to

Ramesh Iyer <rames...@bigpond.com> записано в статью
<36904...@139.134.5.33>...


> I would like to set up a ODBC System DSN complete in all respects which
> includes the server id, user id and password to connect to a remote
server.
>
> Is this possible ?
>
> I am aware that the odbc admin interface does not allow you to create the
> user id and password while defining the dsn.

It's driver-specific feature. Sybase SQL Anywhere can do it.

> .................


> Can this be directly entered into the registry (BTW, the client will be a
NT
> 4 server) ? If so, How?
>
> I need this setup so that I can perform odbcping's within sql scripts
(using
> xp_cmdshell) against remote servers to check the availability of the
remote
> system (odbcping -D <dsn>) to avoid hardcoding the userid and password
> fields (breach of site security policy).
>
> Is there an alternative ?

On server side make special Login ID with NO granted permissions to access
any table.
Name it 'test' and use it for testing (pinging) only. You can use this ID
and password as clear text .Your enemy can't use this login to access any
data.

> Thanks in Advance.
> Ramesh Iyer

--
WBR Andrew Shugol
ir...@online.ru

Mark McCorkindale

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to
Ramesh,

An option is to give it a dummy userid/password and accept "login failed" as
an indication that the server is available.
Eg.

odbcping -D MyDSN -U -P | find /I "sql server not found" >nul && echo "uh
oh.. it's dead" || echo "it's alive!"

NB. Even though I supply no userid/password I purposely *don't* look for the
"login failed" string in the result. This is because the DSN may be defined
as a trusted connection in which case the odbcping would not give an error.

--
Mark McCorkindale
MCSE, OCP
Infotek Systems P/L - Sydney, Australia
m...@infoteksystems.com.au

Ramesh Iyer wrote in message <36904...@139.134.5.33>...


>I would like to set up a ODBC System DSN complete in all respects which
>includes the server id, user id and password to connect to a remote server.
>
>Is this possible ?
>
>I am aware that the odbc admin interface does not allow you to create the
>user id and password while defining the dsn.
>

>Can this be directly entered into the registry (BTW, the client will be a
NT
>4 server) ? If so, How?
>
>I need this setup so that I can perform odbcping's within sql scripts
(using
>xp_cmdshell) against remote servers to check the availability of the remote
>system (odbcping -D <dsn>) to avoid hardcoding the userid and password
>fields (breach of site security policy).
>
>Is there an alternative ?
>

>You can email any ideas to rames...@bigpond.com
>

Susan Schwartz

unread,
Jan 6, 1999, 3:00:00 AM1/6/99
to
Ramesh Iyer wrote:

> I would like to set up a ODBC System DSN complete in all respects which
> includes the server id, user id and password to connect to a remote server.
>
> Is this possible ?
>
> I am aware that the odbc admin interface does not allow you to create the
> user id and password while defining the dsn.
>
> Can this be directly entered into the registry (BTW, the client will be a NT
> 4 server) ? If so, How?
>
> I need this setup so that I can perform odbcping's within sql scripts (using
> xp_cmdshell) against remote servers to check the availability of the remote
> system (odbcping -D <dsn>) to avoid hardcoding the userid and password
> fields (breach of site security policy).
>
> Is there an alternative ?
>
> You can email any ideas to rames...@bigpond.com
>
> Thanks in Advance.
>
> Ramesh Iyer

If you want to edit the registry, you can. And you also need an .ini file:

1. Change the C:\Winnt\odbc.ini file so that it reads:

[ODBC 32 bit Data Sources]
<dsnName>=<driver name>
[dsnName]
Driver32=C:\WINNT\System32\<driver's.dll file>

2. Run regedt32 and make the following changes in the registry:
In the HKEY_LOCAL_MACHINE on Local Machine hive, in the SOFTWARE -> ODBC->
ODBC.INI key
Add value to ODBC Data Sources
Name: <dsnname>
Type: REG_SZ
Data: <driver name>

Add key <dsnname> with the following values:
Value Name Type Data
0 ApplicationName REG_SZ
1 ApplicationUsingThreads REG_SZ 1
2 ArraySize REG_SZ 100
3 Charset REG_SZ
4 CursorCacheSize REG_SZ
5 Database REG_SZ <databasename>
6 Databases REG_SZ
7 Description REG_SZ <optional description>
8 DirectoryServiceProvider REG_SZ
9 Driver REG_SZ C:\WINNT\System32\<driver's .dll file>
10 EnableQuoteIdentifiers REG_SZ 0
11 InitializationString REG_SZ
12 InterfacesFile REG_SZ
13 Language REG_SZ
14 LogonID REG_SZ <logonid >
15 OptimizePrepare REG_SZ 2
16 PacketSize REG_SZ -1
17 PasswordEncryption REG_SZ 0
18 SecurityServiceProvider REG_SZ
19 SelectMethod REG_SZ 1
20 ServerName REG_SZ <servername>
21 Servers REG_SZ
22 WorkstationID REG_SZ

Having said all that, I notice that the registry does not contain the password
(good security move, actually) -- so if you try the ping this way, I'll be
you'll be prompted to enter a password.

The other suggestions sound like better ones.

Susan

0 new messages