The program compiled with VB6 10 years ago will be continuously used for repair, modification, and modification, and will continue to be used for several years.
I recently took over this program, except for the "sad reminder", I really cannot come up with other words to describe my mood.
A little nonsense. Recently, it took some time to call the stored procedure and finally solved the problem. I posted the result. If someone else is using VB6 like me, I hope it will be helpful.
This old program, when calling the Oracle stored procedure, can use different data engines according to the configuration, there are two optional
Provider = oraoledb. oracle.1
Provider = msdaora.1
The code for calling a stored procedure is as follows:
'Cndb. connectionstring = "provider = msdaora.1 ;... "
Cndb. Open
Cmd. activeconnection = cndb
Cmd. commandtype = adcmdstoredproc
Cmd. commandtext = "procname"
Cmd. parameters ("para1") = para1
Cmd. parameters ("para2") = para2
Cmd. Execute 'provider = oraoledb. oracle.1, an error is reported here.
Paraout = cmd ("out") 'the output parameter is of the string type.
If "provider = oraoledb. oracle.1" is used, the error "provider cannot export parameter information and setparameterinfo is not called" is reported when the stored procedure is called ".
If "provider = msdaora.1" is used, the stored procedure is called normally.
I checked some information and changed it to the following code, which can be called normally in either of the following ways:
'Cndb. connectionstring = "provider = msdaora.1 ;... "
Cndb. Open
Cmd. activeconnection = cndb
Cmd. commandtype = adcmdstoredproc
Cmd. commandtext = "procname"
Cmd. Parameters. append cmd. createparameter ("para1", adlongvarchar, adparaminput, 1000, para1)
Cmd. Parameters. append cmd. createparameter ("para2", adlongvarchar, adparaminput, 1000, para2)
Cmd. Execute 'provider = oraoledb. oracle.1, no error is reported
Paraout = cmd ("out") 'the output parameter is of the string type.
If a stored procedure returns a result set, the situation is more complex, see here: http://topic.csdn.net/t/20060323/15/4634977.html