ODBC and UDL related articles

Source: Internet
Author: User
Tags odbc ole

Recently the debugger has experienced some problems with the 32/64-bit ODBC-driven problem on a 64-bit machine, the program uses a UDL file to connect to the database, but there is no 64-bit driver installed on the machine, and how to make the UDL file look for a 32-bit driver, the following article is inspired:

1, ODBC problems in the Server 2003 64 machine: Open Control Panel on Server 2003 64 machine-> Find admin tools-> Find ODBC open-> only SQL Server drivers found in driver options. Click on the System DSN option-> Click Add and found that there is no other only SQL Server, this is my first problem encountered in this. What is the cause of this problem? This problem also took me a lot of time, let me explain:

The problem is that I overlooked the big premise that the operating system is Server 2003 64, and that if you notice the premise, the problem is half done. 64-bit systems are different from 32-bit systems, and ODBC and the following UDL files are related to the system. The ODBC you found on the Control panel is 32-bit so there is no other database driver in it, but it has his own ODBC in the 64-bit system, which is stored in the \windows\syswow64/folder. Then you find Odbcad32.exe in this file, and double-click to open it to see all the database drivers.


2, 32-bit UDL file on the Server 2003 64 machine problems: I use the UDL file on the 32-bit computer to test the connection is not a problem, sent on the 64-bit machines to test the link is a connection error, the hint can not connect to the data source, cannot find the data source, This question also charges me for a long time. In fact, it is also a problem in the system. When a 64-bit system handles a UDL file on a 32-bit system, it has its own strategy. Details of the following English instructions:

"UDL Test" on a-bit machine

Let's say you ' ve started playing with UDL files on your "bit" machine and this tiny little UDL files helped your to Iden Tify connectivity issues or you ' ve easily obtained the OLE DB connection strings for your. So far good. But one day, your followed the same procedure on a-bit machine and couldn ' t-the OLE DB Providers though you ' re sure That's it ' s been installed. There must be something wrong then?

The reason behind is simple. When in a UDL file on a-bit machine, it ' ll enumerate only the clicked bit OLE DB Providers and most Proba Bly you ' ve installed a bit OLE DB Provider.

So then, there should is a way of making UDL Test using the bit OLE DB Providers on a-bit machine.

Actually ' ve created a UDL file on a-bit machine and double clicked on it,

"C:\Program Files\Common Files\System\Ole DB\Oledb32.dll", Opendslfile C:\test.udl

Command would be called through C:\windows\system32\rundll32.exe

Both binaries (Oledb32.dll and rundll32.exe) used here are the bit and the bit Oledb32.dll does not deal with bit OLE DB Providers.

Since we already have bit versions of those Oledb32.dll and rundll32.exe in the other folders on our bit machines, we NE Ed to use them. Therefore, instead of double clicking on the UDL file, we'll need to execute the command below from a command line or Star T/run:

C:\Windows\syswow64\rundll32.exe "C:\Program Files (x86) \common Files\System\Ole db\oledb32.dll", Opendslfile C:\ Test.udl

Et voila:) There you have your bit OLE DB Providers.
The English article above is from http://blogs.msdn.com/b/farukcelik/archive/2007/12/31/ Udl-test-on-a-64-bit-machine.aspx, due to my own English translation level reasons there is no translation, the solution is: C:\Windows\syswow64\rundll32.exe "C:\Program Files ( x86) \common Files\System\Ole db\oledb32.dll "Opendslfile C:\test.udl here is the path to your UDL file. The idea of solving the problem is the same as above.

===========================================================================


1. View 32-bit database-driven methods within 64-bit win system view 32-bit ODBC driver: Start C:/windows/syswow64/odbcad32.exe View 64-bit ODBC driver, start c:/windows/system32/ Odbcad32.exe or go to the Control Panel to view the 32-bit OLE DB driver:
Start a 32-bit CMD environment start C:/windows/syswow64/cmd.exe
Executing the start xxx.udl in this 32-bit environment will start the Rundll32 of the 32-bit subsystem to manage the UDL database connection. 2, view the 64-bit OLE DB driver: Create a new xxx.udl, double-click to open.


3. Other
What folder is SysWOW64?
WoW64 (Windows-on-windows 64-bit) is a subsystem of a Windows operating system

Rundll32.exe c:/progra~1/common~1/system/oledb~1/oledb32.dll,opendslfile%1
C:/windows/syswow64/rundll32.exe c:/progra~2/common~1/system/oledb~1/oledb32.dll,opendslfile%1

Hkey_local_machine/software/odbc
Hkey_local_machine/software/wow6432node/odbc

hkey_classes_root/wow6432node/. UDL
Hkey_classes_root/wow6432node/msdasc/shell/open/command
hkey_classes_root/. UDL
Hkey_classes_root/msdasc/shell/open/command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.