Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with OledbCommand parameters

Status
Not open for further replies.

nzcam

Programmer
Mar 5, 2003
36
NZ
Hi, I have created a oledb connection / command that connects to a oracle 7.3 database .

the oledbCommand was set up in designer that executes a oracle stored procedure with 2 input paramaters with default values.

This all works ok when I pass in the 1st paramater ,but when I try to pass in the second parameter I get exceptions.

Can anyone help me with this problem , It is probably something stupid.

My code is as follows

in designer

olddbCommand (cmdTLRD) set up with paramaters collection - 2 inputs (0 and 1) set up as integer size 9.

In the click event of button

Dim result As Integer
Dim drtlrd As OleDbDataReader

cnTLRD.Open() 'olddbconnection

cmdTLRD.Parameters.Item(0).Value() = ln_start
'cmdTLRD.Parameters.Item(1).Value() = ln_end

(when this line is uncommented exceptions occur)

result = cmdtlrd.ExecuteNonQuery() ' Fails here when 2nd parameter is uncommented.
 
What errors are you getting?

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Hi, Yes I should have added that in a very important piece if info!!

The error I am receiving is ora 1036 illigal variable name/number
 
Thanks for the help, I have now sorted this, It was one of those , if you stare hard enough it will look correct but infact it is not.

The problem was that the fields being passed to the command parameters , the parameters themselves and then finally the stored procedure inputs did not have the same types, easy eh!!

Sorry to bother you all!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top