niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle » Server
Error while calling an Oracle Stored Procedure from VB using ADO
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
macca
*nix forums beginner


Joined: 19 May 2005
Posts: 9

PostPosted: Thu Jul 20, 2006 9:32 am    Post subject: Error while calling an Oracle Stored Procedure from VB using ADO Reply with quote

Hi all, hope you can help me out. I'm getting the following error when
trying to call an oracle stored proc from vb using ado

ORA-01060 array binds or executes not allowed

Does nayone know what needs to be done to correct this? the definition
of the sp and vb code is shown below

PROCEDURE allocate_account_number_ref (i_number_to_allocate IN NUMBER
,i_sort_code IN VARCHAR2
,i_account_type IN VARCHAR2
,i_issued_to IN VARCHAR2
,i_issued_by IN VARCHAR2
,o_account_numbers OUT reftype);

Private Sub UserForm_Initialize()

Dim Conn As String

Set cn = New ADODB.Connection

userId = "xxx"

password = "xxx"

server = "xxx"

On Error GoTo 0

Set cn = New ADODB.Connection

cn.ConnectionString = "Provider=MSDAORA.1;" & _
"Data Source=" & server & ";" & _
"User ID=" & userId & ";" & _
"Password=" & password & ";" & _
"PLSQLRSet=1;"

cn.CursorLocation = adUseClient
cn.Open

qSql = "{call cap_pkg.allocate_account_number({resultset 1,
o_account_numbers},?,?,?,?,?)}"


Set cpw1 = New ADODB.Command


With cpw1
.ActiveConnection = cn
.CommandType = adCmdText
.CommandText = qSql


.Parameters.Append .CreateParameter("i_number_to_allocate",
adNumeric, adParamInput, , 1)

.Parameters.Append .CreateParameter("i_sort_code", adVarChar,
adParamInput, 8, "309713")

.Parameters.Append .CreateParameter("i_account_type", adVarChar,
adParamInput, 3, "001")

.Parameters.Append .CreateParameter("i_issued_to", adVarChar,
adParamInput, 35, "visualbasic")

.Parameters.Append .CreateParameter("i_issued_by", adVarChar,
adParamInput, 35, "visualbasic")

End With

Set rs = New ADODB.Recordset
Set rs = cpw1.Execute
MsgBox "Complete"
rs.Close
End Sub
Back to top
Charles Hooper
*nix forums addict


Joined: 09 Jul 2006
Posts: 51

PostPosted: Thu Jul 20, 2006 11:25 am    Post subject: Re: Error while calling an Oracle Stored Procedure from VB using ADO Reply with quote

macca wrote:
Quote:
Hi all, hope you can help me out. I'm getting the following error when
trying to call an oracle stored proc from vb using ado

ORA-01060 array binds or executes not allowed

Does nayone know what needs to be done to correct this? the definition
of the sp and vb code is shown below

PROCEDURE allocate_account_number_ref (i_number_to_allocate IN NUMBER
,i_sort_code IN VARCHAR2
,i_account_type IN VARCHAR2
,i_issued_to IN VARCHAR2
,i_issued_by IN VARCHAR2
,o_account_numbers OUT reftype);

Private Sub UserForm_Initialize()

Dim Conn As String

Set cn = New ADODB.Connection

userId = "xxx"

password = "xxx"

server = "xxx"

On Error GoTo 0

Set cn = New ADODB.Connection

cn.ConnectionString = "Provider=MSDAORA.1;" & _
"Data Source=" & server & ";" & _
"User ID=" & userId & ";" & _
"Password=" & password & ";" & _
"PLSQLRSet=1;"

cn.CursorLocation = adUseClient
cn.Open

qSql = "{call cap_pkg.allocate_account_number({resultset 1,
o_account_numbers},?,?,?,?,?)}"


Set cpw1 = New ADODB.Command


With cpw1
.ActiveConnection = cn
.CommandType = adCmdText
.CommandText = qSql


.Parameters.Append .CreateParameter("i_number_to_allocate",
adNumeric, adParamInput, , 1)

.Parameters.Append .CreateParameter("i_sort_code", adVarChar,
adParamInput, 8, "309713")

.Parameters.Append .CreateParameter("i_account_type", adVarChar,
adParamInput, 3, "001")

.Parameters.Append .CreateParameter("i_issued_to", adVarChar,
adParamInput, 35, "visualbasic")

.Parameters.Append .CreateParameter("i_issued_by", adVarChar,
adParamInput, 35, "visualbasic")

End With

Set rs = New ADODB.Recordset
Set rs = cpw1.Execute
MsgBox "Complete"
rs.Close
End Sub

Try placing:
cpw1.Prepared = True

Before the .Parameters.Append lines. This may not be the only error in
your code, but it should help.

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
Back to top
macca
*nix forums beginner


Joined: 19 May 2005
Posts: 9

PostPosted: Thu Jul 20, 2006 1:24 pm    Post subject: Re: Error while calling an Oracle Stored Procedure from VB using ADO Reply with quote

Thanks for the feedback. I tried that but it's still the same. Any
other suggestions?




Charles Hooper wrote:
Quote:
macca wrote:
Hi all, hope you can help me out. I'm getting the following error when
trying to call an oracle stored proc from vb using ado

ORA-01060 array binds or executes not allowed

Does nayone know what needs to be done to correct this? the definition
of the sp and vb code is shown below

PROCEDURE allocate_account_number_ref (i_number_to_allocate IN NUMBER
,i_sort_code IN VARCHAR2
,i_account_type IN VARCHAR2
,i_issued_to IN VARCHAR2
,i_issued_by IN VARCHAR2
,o_account_numbers OUT reftype);

Private Sub UserForm_Initialize()

Dim Conn As String

Set cn = New ADODB.Connection

userId = "xxx"

password = "xxx"

server = "xxx"

On Error GoTo 0

Set cn = New ADODB.Connection

cn.ConnectionString = "Provider=MSDAORA.1;" & _
"Data Source=" & server & ";" & _
"User ID=" & userId & ";" & _
"Password=" & password & ";" & _
"PLSQLRSet=1;"

cn.CursorLocation = adUseClient
cn.Open

qSql = "{call cap_pkg.allocate_account_number({resultset 1,
o_account_numbers},?,?,?,?,?)}"


Set cpw1 = New ADODB.Command


With cpw1
.ActiveConnection = cn
.CommandType = adCmdText
.CommandText = qSql


.Parameters.Append .CreateParameter("i_number_to_allocate",
adNumeric, adParamInput, , 1)

.Parameters.Append .CreateParameter("i_sort_code", adVarChar,
adParamInput, 8, "309713")

.Parameters.Append .CreateParameter("i_account_type", adVarChar,
adParamInput, 3, "001")

.Parameters.Append .CreateParameter("i_issued_to", adVarChar,
adParamInput, 35, "visualbasic")

.Parameters.Append .CreateParameter("i_issued_by", adVarChar,
adParamInput, 35, "visualbasic")

End With

Set rs = New ADODB.Recordset
Set rs = cpw1.Execute
MsgBox "Complete"
rs.Close
End Sub

Try placing:
cpw1.Prepared = True

Before the .Parameters.Append lines. This may not be the only error in
your code, but it should help.

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
Back to top
Charles Hooper
*nix forums addict


Joined: 09 Jul 2006
Posts: 51

PostPosted: Thu Jul 20, 2006 1:52 pm    Post subject: Re: Error while calling an Oracle Stored Procedure from VB using ADO Reply with quote

macca wrote:
Quote:
Before the .Parameters.Append lines. This may not be the only error in
your code, but it should help.
Thanks for the feedback. I tried that but it's still the same. Any
other suggestions?

Try modifying the connection string:
Provider=OraOLEDB.Oracle

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
Back to top
macca
*nix forums beginner


Joined: 19 May 2005
Posts: 9

PostPosted: Thu Jul 20, 2006 2:28 pm    Post subject: Re: Error while calling an Oracle Stored Procedure from VB using ADO Reply with quote

already tried that rpovider but VB threw a different error message...

80004005
Unspecified Error

not very helpful

Charles Hooper wrote:
Quote:
macca wrote:
Before the .Parameters.Append lines. This may not be the only error in
your code, but it should help.
Thanks for the feedback. I tried that but it's still the same. Any
other suggestions?

Try modifying the connection string:
Provider=OraOLEDB.Oracle

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
Back to top
Charles Hooper
*nix forums addict


Joined: 09 Jul 2006
Posts: 51

PostPosted: Thu Jul 20, 2006 3:25 pm    Post subject: Re: Error while calling an Oracle Stored Procedure from VB using ADO Reply with quote

macca wrote:
Quote:
Charles Hooper wrote:
macca wrote:
Before the .Parameters.Append lines. This may not be the only error in
your code, but it should help.
Thanks for the feedback. I tried that but it's still the same. Any
other suggestions?

Try modifying the connection string:
Provider=OraOLEDB.Oracle

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
already tried that rpovider but VB threw a different error message...

80004005
Unspecified Error

not very helpful

Take a look at the code examples here:

http://www.oracle.com/technology/sample_code/tech/windows/ole_db/oledb8/index.html

In specific, "Returning multiple recordsets from a stored procedure",
the Form_Load event of the frmPerformance form.

A little test:
Dim db as ADODB.Connection
Dim cmdSQL As New ADODB.Command
Dim parSQLParameter As New ADODB.Parameter
Dim snpDataSQL As New ADODB.Recordset
Dim strSQL as String

Set db = New ADODB.Connection
db.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=" &
strOracleSID & ";User ID=" & strUserName & ";Password=" & strPassword &
";ChunkSize=1000;"
db.ConnectionTimeout = 40
db.CursorLocation = adUseClient
db.Open

strSQL = "SELECT" & vbCrLf
strSQL = strSQL & " SQL_TEXT" & vbCrLf
strSQL = strSQL & "FROM" & vbCrLf
strSQL = strSQL & " V$SQLTEXT" & vbCrLf
strSQL = strSQL & "WHERE" & vbCrLf
strSQL = strSQL & " HASH_VALUE= ?" & vbCrLf
strSQL = strSQL & "ORDER BY" & vbCrLf
strSQL = strSQL & " PIECE"
cmdSQL.CommandText = strSQL
cmdSQL.CommandType = adCmdText

cmdSQL.Prepared = True
Set parSQLParameter = cmdSQL.CreateParameter("hash", adDouble,
adParamInput, 16, 3969931980#)
cmdSQL.Parameters.Append parSQLParameter

cmdSQL.ActiveConnection = dbVMFG
Set snpDataSQL = cmdSQL.Execute

'Specify a different hash to retrieve:
cmdSQL("hash") = 3969930000#
Set snpDataSQL = cmdSQL.Execute
strSQL = ""
Do While Not (snpDataSQL.EOF)
strSQL = strSQL & snpDataSQL("sql_text")
snpDataSQL.MoveNext
Loop

If you specify the correct Oracle SID, user name, and password, do you
still receive an unspecified error message when executing the code
above? Specify an actual hash value, does it retrieve the correct SQL
statement from the database?

If you can make the above work, try adapting it to work with your
stored procedure. Consult the Oracle publish code example to help you
adapt the example above.

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 8:34 pm | All times are GMT
navigation Forum index » Databases » Oracle » Server
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts postfix smtp authentication using mysql stored user/pass rtresidd Postfix 0 Fri Oct 03, 2008 5:58 am
No new posts Postfix + MySQL error: very strange variable %s iWarior Postfix 0 Mon Aug 25, 2008 2:01 pm
No new posts ** Postfix error on console every minute or so ** ?? drywash Postfix 0 Fri Jul 04, 2008 8:49 pm
No new posts Postfix error bounce diwash Postfix 0 Fri Mar 28, 2008 3:37 am
No new posts I am getting following error in Aix 5.3 rockcharles1 AIX 0 Tue Aug 28, 2007 11:06 pm

Mortgage | Debt Help | Free Advertising | Books | Mortgage Calculator
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2495s ][ Queries: 16 (0.1443s) ][ GZIP on - Debug on ]