M*******r 发帖数: 522 | 1 最近正在把一个vb6 app转成vb.net。原vb6 app是用oo4o连接到oracle db。现在vb.net
里改用OleDb连接。原程序对DbException做如下处理:
Select Case oSession.LastServerErr
Case 1017
Msg = "Error trying to login into Oracle: Invalid User Id/Password."
Case Else
Msg = "Error trying to login into Oracle"
End Select
问题是,如何从OleDbException当中获取这个oracle error code 1017. 当然这个1017在
exception.message里,但问题是除了parse string之外是否有更好的办法?
多谢。 |
p***n 发帖数: 635 | 2 有个更无聊的办法是在ORACLE STORED PROCEDURE中
直接把ERROR CODE作为输出参数返回.
【在 M*******r 的大作中提到】 : 最近正在把一个vb6 app转成vb.net。原vb6 app是用oo4o连接到oracle db。现在vb.net : 里改用OleDb连接。原程序对DbException做如下处理: : Select Case oSession.LastServerErr : Case 1017 : Msg = "Error trying to login into Oracle: Invalid User Id/Password." : Case Else : Msg = "Error trying to login into Oracle" : End Select : 问题是,如何从OleDbException当中获取这个oracle error code 1017. 当然这个1017在 : exception.message里,但问题是除了parse string之外是否有更好的办法?
|
M*******r 发帖数: 522 | 3 古狗了半天,看来Framework 1.1里有System.Data.OracleClient,
能给OracleException,其中有code...
可惜这里只有vs2002,不能用1.1... tnnd
db。现在vb.net
Id/Password."
当然这个1017在
【在 p***n 的大作中提到】 : 有个更无聊的办法是在ORACLE STORED PROCEDURE中 : 直接把ERROR CODE作为输出参数返回.
|
e****e 发帖数: 1775 | 4 u can use ODP.NET
u can download it from oracle's site
【在 M*******r 的大作中提到】 : 古狗了半天,看来Framework 1.1里有System.Data.OracleClient, : 能给OracleException,其中有code... : 可惜这里只有vs2002,不能用1.1... tnnd : : db。现在vb.net : Id/Password." : 当然这个1017在
|
d*r 发帖数: 238 | 5 if he could do that, he could install 1.1
【在 e****e 的大作中提到】 : u can use ODP.NET : u can download it from oracle's site
|
M*******r 发帖数: 522 | 6 其实client的机器上装的倒是1.1 -- 偶们反而要用1.0... ft
【在 d*r 的大作中提到】 : if he could do that, he could install 1.1
|
d*r 发帖数: 238 | 7 ask your admin to install 1.1 or maybe 2.0 directly at the end of this year. :)
【在 M*******r 的大作中提到】 : 其实client的机器上装的倒是1.1 -- 偶们反而要用1.0... ft
|
M*******r 发帖数: 522 | 8 这帮土人只有visual studio 2002, 装了1.1也用不上...
anyway, 有什么条件上什么code, client is not to be complained, hoho
【在 d*r 的大作中提到】 : ask your admin to install 1.1 or maybe 2.0 directly at the end of this year. :)
|
p*p 发帖数: 75 | 9 visual studio is not a must. .NET framework and SDK is good enough.
year. :)
【在 M*******r 的大作中提到】 : 这帮土人只有visual studio 2002, 装了1.1也用不上... : anyway, 有什么条件上什么code, client is not to be complained, hoho
|
d*r 发帖数: 238 | 10 Can you get InnerException of DataException?
【在 M*******r 的大作中提到】 : 这帮土人只有visual studio 2002, 装了1.1也用不上... : anyway, 有什么条件上什么code, client is not to be complained, hoho
|