473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Automating installation of ODBC data source

Is there a script anyone has that will automate the addition of an
access database to the OBDC datasources in control panel.

Thanks

Jul 20 '05 #1
1 6882
Tcs
Here's something that I did in Kixtart for our environment. It was last
November, so I don't recall all the details. Some key values I would expect to
vary, as I have six (6) scripts for all the data sources we have. I figured out
what to do by checking the registry, and creating a script that would duplicate
what I had done manually.

Also, since it was three (3) PCs ago, I don't recall what OS it was. Since I've
been here, I've had three (3) PCs. This one is XP, the previous was w2k and the
first? MAY have been NT. I mention this as I don't know if it'll require any
changes in the script.

Here it is (between the lines of '=========='):
==========
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;
; Kixtart script - create Data Source Entries for HTE applications ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;
; ;
; 11-10-03 tcs initial creation date. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;
;
; *** NOTE ***
;
; Path to 'cwbodbc.dll' must be modified as necessary. For example,
; as originally written, the path is:
;
; d:\IBM\Client Access\Shared\cwbodbc.dll
;
; which was correct for the machine upon which this script was developed.
;
;================================================= ====================
;
;Setup ODBC for HTE DB2 database [Begin]
;Create the necessary keys, values and expressions for current user.
$CR=chr(13)
$HteDSN='Finance'
$KeyBase='HKEY_CURRENT_USER\Software\ODBC\ODBC.INI '
$Key1='$KeyBase\ODBC Data Sources'
$Key2='$KeyBase\$HteDSN'
if existkey($Key2) ; key doesn't exist, so create it.
$result=addkey($Key2)
$result=writevalue($Key1,'$HteDSN','Client Access ODBC Driver
(32-bit)','REG_SZ')

$result=writevalue($Key2,'AllowDataCompression','0 ','REG_SZ')
$result=writevalue($Key2,'AllowUnsupportedChar','0 ','REG_SZ')
$result=writevalue($Key2,'AlwaysScrollable','0','R EG_SZ')
$result=writevalue($Key2,'BlockSizeKB','32','REG_S Z')
$result=writevalue($Key2,'CCSID','','REG_SZ')
$result=writevalue($Key2,'CommitMode','0','REG_SZ' )
$result=writevalue($Key2,'ConnectionType','0','REG _SZ')
$result=writevalue($Key2,'DateFormat','5','REG_SZ' )
$result=writevalue($Key2,'DateSeparator','1','REG_ SZ')
$result=writevalue($Key2,'Decimal','0','REG_SZ')
$result=writevalue($Key2,'DefaultLibraries','atlib , prlib, pilib, gmlib,
fmlib, mrlib, crlib, gflib, falib, wflib, lxlib, malib','REG_SZ')
$result=writevalue($Key2,'DefaultPkgLibrary','QGPL ','REG_SZ')
$result=writevalue($Key2,'Description','Client Access Express ODBC data
source','REG_SZ')
$result=writevalue($Key2,'Driver','d:\IBM\Client
Access\Shared\cwbodbc.dll','REG_SZ')
$result=writevalue($Key2,'ExtendedDynamic','0','RE G_SZ')
$result=writevalue($Key2,'ForceTranslation','0','R EG_SZ')
$result=writevalue($Key2,'LanguageID','ENU','REG_S Z')
$result=writevalue($Key2,'LazyClose','0','REG_SZ')
$result=writevalue($Key2,'LibraryView','0','REG_SZ ')
$result=writevalue($Key2,'ManagedDataSource','0',' REG_SZ')
$result=writevalue($Key2,'MaxFieldLength','32','RE G_SZ')
$result=writevalue($Key2,'Naming','0','REG_SZ')
$result=writevalue($Key2,'ODBCRemarks','0','REG_SZ ')
$result=writevalue($Key2,'PreFetch','0','REG_SZ')
$result=writevalue($Key2,'RecordBlocking','2','REG _SZ')
$result=writevalue($Key2,'SearchPattern','1','REG_ SZ')
$result=writevalue($Key2,'Signon','0','REG_SZ')
$result=writevalue($Key2,'SortSequence','0','REG_S Z')
$result=writevalue($Key2,'SortTable','','REG_SZ')
$result=writevalue($Key2,'SortWeight','0','REG_SZ' )
$result=writevalue($Key2,'SSL','2','REG_SZ')
$result=writevalue($Key2,'System','10.4.1.1','REG_ SZ')
$result=writevalue($Key2,'TimeFormat','0','REG_SZ' )
$result=writevalue($Key2,'TimeSeparator','0','REG_ SZ')
$result=writevalue($Key2,'TranslationDLL','','REG_ SZ')
$result=writevalue($Key2,'TranslationOption','','R EG_SZ')
$result=writevalue($Key2,'','','REG_SZ')
$result=writevalue($Key2,'','','REG_SZ')
$result=writevalue($Key2,'','','REG_SZ')
$result=writevalue($Key2,'','','REG_SZ')
endif
;Setup ODBC for HTE DB2 Server [End]
==========
I don't think that I fully finished, so I'd tread lightly, but hopefully this'll
get you started.

Tom

On Wed, 23 Jul 2003 10:49:53 +0000 (UTC), SkunkDave
<da***********@totalise.co.uk> wrote:
Is there a script anyone has that will automate the addition of an
access database to the OBDC datasources in control panel.

Thanks


Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jerry Weinstein | last post by:
Hi, I know about stored procedures and that they can speed up data entry via the SQL 'insert ' statement. However, one drawback to this method is that using the stored procedure still requires...
2
by: Nate | last post by:
Hello, I am trying to recover a SQL Server 7 database from another hard disk drive that has a corrupted Windows 2000 Advanced Server installation. I am not able to repair the corrupted Windows...
2
by: Jimbo | last post by:
I am trying to install Sql Server on a Win 2000 Server...It keeps failing and I dont know why...I turned off my anti-virus for installation and am logged in as an admin..heres the output of the...
2
by: jmev7 | last post by:
Any way to avoid having to manually enter my user name & password for the Oracle login box? I normally run a query on an attached Oracle table and have to enter the un/pw before the query will run....
4
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always...
2
by: somersbar | last post by:
im trying to get a basic ASP.NET application running. im trying to display data from a microsoft access database on my web form. im trying to bind the data to a data-grid. but i get the following...
1
by: John Welch | last post by:
I'm trying to use the Mergit() function from the MS Knowledge base article to merge data from a query or table in my Access 2000 mdb into an existing word merge document. Every time it runs it...
3
by: Salad | last post by:
With the database window open I click on Help, then click on "About Microsoft Office Access". A dialog window is presented and there are 4 buttons at the bottom right of the form. One is...
1
by: sureshbup | last post by:
Hi to all, I am trying to install CPAN modules using the command perl -MCPAN -e 'install qw (Text::CSV_XS)' but i get the problem like this even i changed the working proxies but none is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.