Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

VB6 program and Ora-06413 solution letter

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The reason:

Win7 x64 platform, Vb6 program starts, directly can not be enabled

Vb6 is relatively old and should be a product of the Stone Age; at first glance, this error should be related to the oracle environment variable, while a friend confirmed that oracle 9i client 32-bit was installed.

After:

As the program is relatively bullshit, did not throw the correct information on the error exception, fortunately there is still source code on hand, press f8 step to take a look, the following debugging part directly reported: ora-06413: the connection is not open. Look at the code, a more general code to open the database with ado, add the red part, regenerate the vb program, saving each time a single step debugging.

Function OpenDBConnection (cn AsADODB.Connection, strCnn As String) As Boolean On Error GoTo OpenMainSybaseError Set cn = New ADODB.Connection With cn .CursorLocation = adUseClient .ConnectionString = strCnn .ConnectionTimeout = 10.Properties ("Prompt") = adPromptNever .Open End With OpenDBConnection = True MsgBox "dbconnectstring is" + strCnn Exit FunctionOpenMainSybaseError: MsgBox Err.Description OpenDBConnection = FalseEnd Function

Start the program again, and throw out the error directly: the ORA-06413 connection is not open

Take a look at the connection string:

Provider=MSDAORA;data source=ora;UserId=cxf1;Password=test;Unicode=True

After using msdaora,tnsping ora for a while, there is no problem; so the problem is, the problem of msdaora? This driver does have an official explanation.

Https://www.microsoft.com/en-US/download/details.aspx?id=20065

Only 2003 and xp versions are available, but later check

C:\ Program Files (x86)\ Common Files\ System\ Ole DB

It seems that there are three files directly under 64-bit: msdaOra.dll,msdaosp.dll,msdaOrar.dll does not need additional drivers.

But since I suspected this, I tried to use OraOleDb.Oracle.1 and made a mistake. I even reported tns-12514, which still seems to have something to do with environmental variables. The following story is boring, just install and uninstall ora92 version, reinstall oracle 10g client, still, uninstall 10g client with 11g, not even 32 bits, or try 64-bit, install 11g 64-bit, directly report that the driver is not enabled:

I'm a little sick, I'm in a hurry, and I'm going to go to the hospital at random. All right, let's think about it:

1 64-bit certainly can't, because at that time 32-bit vb didn't know anything about 64-bit.

210g 32-bit client can prove to tsn-12514 that this driver should be available, but the environment variable is incorrect.

Re-went to the official website of the next oracle, saying that it provided a 32-bit odac driver.

Http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html

Boy, directly downloaded a minimum version of 10G, why the lowest, you know, vb6 this veteran does not make mistakes; the result can not be installed, normal, 10g, installed on 64-bit to change the oraparam.ini

[Certified Versions]

# You can customise error message shown for failure,provide value for CERTIFIED_VERSION_FAILURE_MESSAGE

Windows=4.0,5.0,5.1,5.2,6.0,6.1

OK, OK is installed, test ODBC, everything is normal, everything OK, open the program, still report to ora-06413.

There's nothing I can do. Look at sqlnet.log and find out:

* Fatal NI connect error 6413 Connecting to: (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=TCP) (HOST=115.29.114.XXX) (PORT=1521) (CONNECT_DATA= (SERVICE_NAME=orcl) (CID= (PROGRAM=C:\ test ()\ ttest.exe) (HOST=SNOWIND-PC) (USER=snowind) VERSION INFORMATION: TNSfor 32-bit Windows: Version 10.2.0.1.0-Production Time: December-December-2016 21:20:45 Tracing not turned on.

Basically guessed the problem (alas, by guessing-_ -!).

Open the debugger and link the properties again:

Finally succeeded (can play × ×).

Conclusion:

Don't put parentheses in the path, or you will lose face; adding a little exception handling to the code will not add much work, and it can also benefit future generations.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report