Using ODBC to access 32-bit oracle on a 64-bit Server

Source: Internet
Author: User

In the project of the Security Supervision Bureau, the Internet website needs to display the enterprise declaration result. The website is developed by another company and the database is Oracle. We originally wanted to open an account to allow them to access our database, but people do not want. Later, after being determined by the information center, they opened the database. We created tables with the same structure in their Oracle database and then wrote data to the table.

At the beginning, we thought about connecting the Oracle database to the server and passed it on my local 32-bit sqlserver, but it was useless on the server (64, finally, I had to give up this method, but I still couldn't find the reason. Later I wanted to write a Windows program to allow the program to retrieve data from the 64-bit database, and then connect to the Oracle database by creating a data source, after the data source is created, the test can be performed on both the local server and the 64-bit server, but the program reports an error after obtaining the 64-bit server, saying that the driver name and default data source are not specified. Then, I tried it for a long time, change project properties-generate-target platform from any CPU to x86.

Attached tnsname. ora:

Jiarui2 =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = 10.10.30.12) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)

The driver used to create the data source is Oracle in orahome90, And the TNS service name is set

Jiarui2, set the account and password to guide, and the data source name to dsn_jiarui. odbcconnection, odbcdataadapter, and odbccommand are used in the program. The database connection string is:

DSN = dsn_jiarui; uid = guide; Pwd = guide; others are the same as accessing SQL Server.

 

 

Related Article

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.