Re: Problem with refreshing parameters in ADO

From: Val Mazur (group51a_at_hotmail.com)
Date: 06/24/04


Date: Wed, 23 Jun 2004 22:03:56 -0400

Hi,

Using Refresh method to get a collection of the parameters is not a reliable
way anyway. Even MDAC says that Refresh will fail in some cases or it could
return incorrect information. It depends on a provider's capabilities. I
would suggest to avoid to use Refresh and define parameters explicitly.

-- 
Val Mazur
Microsoft MVP
"Culture" <limivorous@hotmail.com> wrote in message 
news:c6a64544.0406220844.bf8d19f@posting.google.com...
> My code (running in access 2002) is:
>
> Private Sub GatherInfo_Click()
> On Error GoTo Err_GatherInfo_Click
> Const adCmdStoredProc = &H4
>  Dim strConnect
>  Dim vDatabase
>  Dim vUsername
>  Dim vPassword
>  Set ObjConn = New ADODB.Connection
>
>  vDatabase = "USER"
>  vUsername = "PASSWORD"
>  vPassword = "DB"
>
>  strConnect = "Provider=MSDAORA;Data Source=" & vDatabase & ";User
> ID=" & vUsername & ";Password=" & vPassword & ";"
>  ObjConn.Open strConnect
>
>  Set StdProc = New ADODB.Command
>
>  Set StdProc.ActiveConnection = ObjConn
>
>  StdProc.CommandType = adCmdStoredProc
>  StdProc.CommandText = "P_INFO.RUNEXPORT"
>  StdProc.Parameters.Refresh
>
>  ......
>  End Sub
>
> The problem is, when it gets to StdProc.Parameters.Refresh it errors
> with
> "Unspecified error"
> Whatever i do i can't seem to refresh the parameters....
> Could it also be to do with the references????
>
> Thanks in advance :)
>
> Craig 


Relevant Pages

  • Re: Quick Search Combo Box
    ... Thanks for the hint on the location of the macro action, "refresh." ... Private Sub Combo15_AfterUpdate ... Dim rs As Object ... Dim stDocName As String ...
    (microsoft.public.access.forms)
  • Re: database refresh from code
    ... the shape and set the database link in the first place. ... Borrowing this for the refresh did not work either, ... Dim cellobj As Cell ... Sub RefreshShapes12 ...
    (microsoft.public.visio.developer)
  • Re: Problem with refreshing parameters in ADO
    ... Well, if MDAC is unreliable, and you know you're using MS SQL SErver v 2000 ... Even MDAC says that Refresh will fail in some cases or it ... >> Dim strConnect ... >> Set ObjConn = New ADODB.Connection ...
    (microsoft.public.data.ado)
  • Updating Ref fields
    ... but the fields won't refresh. ... Dim objOffice ... Set objOffice = CreateObject ... For Each pRange In ActiveDocument.StoryRanges ...
    (microsoft.public.scripting.vbscript)
  • Re: Modify Pivot Table SourceData range
    ... Tom Ogilvy ... Then to refresh a new range. ... Dim DRow As Long, SRow As Long ...
    (microsoft.public.excel.programming)