all groups > sql server odbc > may 2006 >
You're in the

sql server odbc

group:

Change servername based on logon server


Change servername based on logon server Ben
5/8/2006 10:33:55 AM
sql server odbc: Hi

We are to use an application on two replicated sites, the application uses a
user dsn.

We propose to use a reg file attached to a logon script to amend the server
name so that users with laptops can move transparently between sites.

Is this the best method or is there another?

Thanks
B

Re: Change servername based on logon server Mike C#
5/11/2006 9:31:05 PM
A registry file? Sounds dangerous.

[quoted text, click to view]

Re: Change servername based on logon server Mike C#
5/13/2006 6:30:58 PM
That's probably the easiest method, but it would be really easy for some to
alter the reg files and screw up a registry pretty badly. For constantly
changing servers, maybe a File DSN would be a more secure bet? For security
purposes, if you want to mess directly with the registry, maybe adding a
short application to the logon script that only touches the registry keys
you really want to change would be a more secure bet? I'd just be a little
hesitant about installing nondescriminating reg files on user computers.

[quoted text, click to view]

Re: Change servername based on logon server Ben
5/13/2006 10:25:55 PM
Hi

Yes the server name is stored in the HKCU.

We use reg files regularly to update other required settings to the HKCU.

But is there a reccomended method?

Thanks

B

[quoted text, click to view]

Re: Change servername based on logon server Ben
5/23/2006 10:11:42 PM
Hi Mike,

Thanks for your post, and sorry for the delay in replying, sadly our
Software Vendor only Supports User and System DSNs.

The logon script / reg file is in a secure location on the server where
users do not have write access, it will run on each boot so if the user
messes with the registry: after a boot we are sorted again. Thankfully I
think they all have not even heard of a registry let alone know how to open
regedit :-)

Thanks
B

[quoted text, click to view]

Re: Change servername based on logon server Mike C#
5/24/2006 2:43:28 PM
Hi Ben,

I'd still be concerned that the registry file could be altered at some point
before being installed on the system (a disgruntled IT employee? hacker?
curious employee? who knows...) Of course that's just my initial thoughts,
but I'd be hesitant to send .reg files to be directly imported into the
registry. Personally I prefer the idea of some form of small validating
application called from the script to ensure direct registry updates are
within a very well-defined and narrow scope. In fact, since you're doing
DSNs, I might even go a step further and suggest using the ODBC API to
update them instead of writing the registry directly. Presumably the ODBC
API offers additional validation of the DSN as well (i.e., length of DSN
name, etc.)

Anyway, best of luck!

Mike



[quoted text, click to view]

AddThis Social Bookmark Button