Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to create user.dsn for all profiles on Win2003 server

Status
Not open for further replies.

yolly12

MIS
Mar 21, 2005
83
hello,

I need to create a dbase user.dsn on my Win2003 standard server that is accessable by all of the user profiles.

Right now I have been logging each user in locally and manually creating the user.dsn and that is not the most exciting thing that I can think of. I have about 100 users so I am looking for a shortcut or 2.

Are there any?
 
yolly12

You should be able to create 1 system DSN on the server that will be accessable for all users. Also, like Mark said you can script it with a .reg file.

John
 
thnks for your help. I ended up exporting a couple of .reg files that work for me and importing them manually on the user profiles.

I have run into an oddity though. I gave the usergroup permission to write to the registry and the network admin made that usergroup (active directory domain group) admin rights on these servers adn then I found the msiexec.exe file and gave the usergroup full rights to it but when you fire it off you get an installer error and then the program appears to be fine (Word 2003 or Outlook 2003)According the event viewer the error says that the registry key that I imported in does not exist. event id 1719. I went back in as the users and that key is there alright so I have no clue what I am missing.
 
You should be able to avoid the errors if you build the DSN rather than import the reg file.

Note that if a password is needed you will need to script using sendkeys to open the ODBC connection and then type the password as scripting of passwords for ODBC is not supported by Windows.

Code:
Dim oWshShell

  Set oWshShell = CreateObject ("WScript.Shell")

  oWshShell.RegWrite "HKCU\Software\ODBC\ODBC.INI\Batman\Driver","C:\\WINNT\\System32\\sqlsrv32.dll"
  oWshShell.RegWrite "HKCU\Software\ODBC\ODBC.INI\Batman\Server","GothemCity"
  oWshShell.RegWrite "HKCU\Software\ODBC\ODBC.INI\Batman\Database","pubs"
  oWshShell.RegWrite "HKCU\Software\ODBC\ODBC.INI\Batman\LastUser","Alfred"

  oWshShell.RegWrite "HKCU\Software\ODBC\ODBC.INI\ODBC Data Sources\Batman","SQL Server"

  set oWshShell = Nothing

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top