Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 14th, 2006, 02:25 PM
Registered User
Join Date: Oct 2006
Location: tcr, kerala, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default help please


I have created a program which uses access as the database. I wish to give it to my friends, but some of them are not much aware of windows administration.

Can i create a .bat file which can add the DSN for my database

Thanks in advance,

Alfahed p m
  #2 (permalink)  
Old October 17th, 2006, 02:21 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

You need to create a .vbs script that will create the DSN.

Here is one for a SQL Server to get you started.

Uninstall your current DSN, then install it and note the changes, and document them.

You could also use a DSN-less provider statement so you wan't have to do this.

Let me know if you need additional help.

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\AssetManagement\Descr iption", "SQL"
WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\AssetManagement\Drive r", "C:\Windows\System32\\SQLSRV32.dll"
WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\AssetManagement\LastU ser", "Unknown"
WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\AssetManagement\Serve r", "SQLDatabaseName"
WshShell.RegWrite "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\AssetManagement", "SQL Server"


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.