LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Parameters.Refresh

I was looking for documentation as to what the Parameters.Refresh method
does. I suspect that it is somehow initializing the Parameter oject within
the Command with the number of parameters which are in my stored procedure.

Anyway, when I get to that line of code I get a "-2147217900 (80040e14)" and
that message says, more or less that my SQL statement is invalid. The only
SQL statement I have is what is calling the stored procedure. In the message
box I seem to be getting message back from Oracle indicating that I have the
wrong number of paramters and/or the wrong types. At this juncture, I have
not loaded my parameters.

Here is my code....

Dim cnn As New ADODB.Connection
Dim Rs As ADODB.Recordset
cnn.ConnectionString = "Provider=MSDAORA.1;Password=YYYYYYYY;User
ID=XXXXXX;Data Source=ZZZZZZZZZZ;Persist Security Info=True"
cnn.Open

Dim cmd As New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "OPS_UI_QUERIES.QRY_PROD_Data"
cmd.Parameters.Refresh

cmd.Parameters(1).Name = "i_User_ID"
cmd.Parameters(1).Type = adInteger
cmd.Parameters(1).Value = 1
cmd.Parameters(2).Name = "i_Time_ID"
cmd.Parameters(2).Type = adInteger
cmd.Parameters(2).Value = 136

Set Rs = cmd.Execute

Any ideas as to what is wrong?

Thanks in advance for your assistance.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel crash when refresh pivottable which have parameters set on c Rui Rosa Mendes Excel Discussion (Misc queries) 1 December 31st 10 11:19 AM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) Anant[_2_] Excel Programming 1 August 6th 03 04:22 AM


All times are GMT +1. The time now is 08:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"