Showing posts with label odbc. Show all posts
Showing posts with label odbc. Show all posts

Thursday, March 29, 2012

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.

ThanksHere'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
<dave_casserly@.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

Thursday, March 22, 2012

Automatically create ODBC connections

Hello everybody!

I'm using the 'Data Sources (ODBC)' program that comes with windows to
create the odbc connections I need. Although that is quite fast and easy I
would like to have it more automated, since I'm using the same parameters
all the time.
Can anybody tell me (or give pointers to) how that is done?

regards
--
Johnny LjunggrenJohnny Ljunggren <johnny@.navtek.no> wrote in message news:<pan.2004.08.18.07.59.24.480484@.navtek.no>...
> Hello everybody!
> I'm using the 'Data Sources (ODBC)' program that comes with windows to
> create the odbc connections I need. Although that is quite fast and easy I
> would like to have it more automated, since I'm using the same parameters
> all the time.
> Can anybody tell me (or give pointers to) how that is done?
> regards

This article (or one of the ones linked from it) might be useful:

http://support.microsoft.com/defaul...b;en-us;Q184608

If not, you should probably ask this in an ODBC group, since it's not
really an MSSQL question.

Simon|||Den Wed, 18 Aug 2004 07:13:16 -0700, skrev Simon Hayes:

>> I'm using the 'Data Sources (ODBC)' program that comes with windows to
>> create the odbc connections I need. Although that is quite fast and easy I
>> would like to have it more automated, since I'm using the same parameters
>> all the time.
>> Can anybody tell me (or give pointers to) how that is done?
> This article (or one of the ones linked from it) might be useful:
> http://support.microsoft.com/defaul...b;en-us;Q184608

Looks like this might solve my problem. Thanks a lot.

> If not, you should probably ask this in an ODBC group, since it's not
> really an MSSQL question.

I know, but my newsprovider doesn't have any odbc-groups, so I thought
this was close enough....

--
Johnny Ljunggren

Wednesday, March 7, 2012

automate way to build an odbc connection

is there is an automate way to build an odbc connection without usin the
windows "odbc data source administrator"?
thanks
You can programmatically create DSNs - they are just
registry entries really. Most of the examples you can find
just write to the registry. Here are a couple of samples
that should have enough information to get you going:
How To Programmatically Create a DSN for SQL Server with VB
http://support.microsoft.com/?id=184608
How to Create ODBC DSN on multiple SQL server machines
http://www.databasejournal.com/featu...le.php/2238221
-Sue
On Thu, 28 Sep 2006 15:23:24 +0200, "Sam"
<focus10@.zahav.net.il> wrote:

>is there is an automate way to build an odbc connection without usin the
>windows "odbc data source administrator"?
>thanks
>

automate way to build an odbc connection

is there is an automate way to build an odbc connection without usin the
windows "odbc data source administrator"?
thanksYou can programmatically create DSNs - they are just
registry entries really. Most of the examples you can find
just write to the registry. Here are a couple of samples
that should have enough information to get you going:
How To Programmatically Create a DSN for SQL Server with VB
http://support.microsoft.com/?id=184608
How to Create ODBC DSN on multiple SQL server machines
http://www.databasejournal.com/feat...cle.php/2238221
-Sue
On Thu, 28 Sep 2006 15:23:24 +0200, "Sam"
<focus10@.zahav.net.il> wrote:

>is there is an automate way to build an odbc connection without usin the
>windows "odbc data source administrator"?
>thanks
>