Tuesday, March 2, 2010

Creating new ODBC connection on 64-bit Vista/ODBC driver for 64-bit Vista

If u are trying to make a odbc connection to say MS Access or Excel, so that it can be used by a programming language (like java), on a 64-bit OS. Then the things u need to do are:
1.)Go to Control Panel
2.)Go to Administrative Tools
3.)Right click on Data Sources and go to its properties
4.)In properties change the following and click 'OK'
Target field to:
%SystemRoot%\SysWOW64\odbcad32.exe
From:
%SystemRoot%\System32\odbcad32.exe
Start In to:
%SystemRoot%\SysWOW64
From:
%SystemRoot%\System32
5.)Having done the above go to Data Sources and in that go to System DSN.
6.)In System DSN click on Add and select the driver u want and click 'Finish'.
eg. Driver *.mdb(for Access 2003), *.accdb(for Access 2007), *.xls(for Excel) and so on.
7.)Having done this Select the file u want by going to 'Select' and choosing the file u want to use
in ur program and give the Data Source Name(DSN) the same as name the name of ur
file.This will do the job.
Note: The DSN need not be the same as the name of the file. But what ever u give the DSN ,makes ure u use that in ur program to get Connection.

No comments:

Post a Comment