Re: Cannot clear ADO Errors

From: Mike T (anonymous_at_discussions.microsoft.com)
Date: 04/14/04


Date: Wed, 14 Apr 2004 11:11:03 -0700

Val,

Thanks for the suggestion, but still no dice. The errors preexist in the Access Project's connection object, so no matter where/how I instantiate the local object, the errors are still there.

        Dim cmd As ADODB.Command
        Set cmd = New ADODB.Command
        cmd.ActiveConnection = CurrentProject.Connection

They show up in my local object as soon as I assign the Project's connection to the local command object.

I haven't tried establishing a completely separate connection for the local work, so I don't know if that would work or not. My understanding is that an Access Project maintains a connection to its data source throughout the application's lifetime, so it seems like using that connection is the right thing to do.

So ideally, I'd like to either a) find out and correct what's causing the errors in the first place, and/or b) be able to clear them.

Any further thoughts?

TIA,
Mike
     
     ----- Val Mazur wrote: -----
     
     Hi Mike,
     
     If it does not work, then you could reset your command variable. First set
     tit to Nothing and then instantiate it again. Another suggestion (which is
     not related to the problem, but could cause it) is to split declaration and
     instantiation of the variable. Otherwise it could lead to the memory leaks
     and some other issues
     
     Dim cmd As ADODB.Command
     Set cmd = New ADODB.Command
     
     --
     Val Mazur
     Microsoft MVP
     
     
     "Mike T" <mtmail@optonline.net> wrote in message
     news:C0238335-E047-4AE0-B82D-C7DBC4275A9D@microsoft.com...
>I have an Access Project (.adp) which connects to a local instance of MSDE.
>I have no problem connecting, retrieving data, or executing stored
>procedres. However, I have the following two persistent errors in the
>CurrentProject.ActiveConnection.Errors collection:
>> Number : -2147217887
> Description : "One or more properties cannot be returned."
> NativeError : 44
> Source : "MSDataShape"
> and
> Number : -2147217887
> Description : "Provider does not support the property."
> NativeError : -2147217887
> Source : "ADODB.Connection"
>> I'm using an ADO.Command object to execute stored procedures:
>> Dim cmd As New ADODB.Command
> cmd.ActiveConnection = CurrentProject.Connection
>> The errors preexist in the Application's ActiveConnection object.
> Executing:
>> cmd.ActiveConnection.Errors.Clear
>> does absolutely nothing.
>> I'd really like to be able to inspect the ADO.Errors collection after each
> call, but I can't seem to get rid of these errors. Since the connection
> string was automagically set by Access when I went through the initial
> connection dialog, it's bound to be absolutely, 100% correct for my
> scenario, right? Well, in any case, it's:
>> ConnectionString : "Provider=MSDataShape.1;Persist Security
> Info=False;Data Source=SHEL00MIS00364;User ID=sa;Initial
> Catalog=defectsSQL;Data Provider=SQLOLEDB.1"
>> Any help would be greatly appreciated!
>



Relevant Pages

  • Re: local devices in a terminal session problem
    ... terminal connection) and he opens the terminal connection and puts the ... account problem in the terminal server. ... The suggestion 1 is out because we only have one terminal server. ...
    (microsoft.public.windows.terminal_services)
  • Re: open DataReader associated with this Connection
    ... Thanks for the suggestion. ... I am using the right version of .NET framework. ... Like Kevin had suspected I am not using new connection for each fill. ... >> newsgroups that if I handle the FillError event and set the continue ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: not starting the syncronization with QTEK 9100
    ... So following your suggestion, it was true that the TCP/IP was not set, I ... Microsoft MVP - Mobile Devices ... I know how to get to my network connection, I have a LAN, a Wireless one, ...
    (microsoft.public.pocketpc.activesync)
  • Thanks: Steve Winograd://Re: Crossover Cable/ Transfer Wizard
    ... Thanks for your suggestion and advice, ... >Make sure that XP's local area network connection is ... Go to Control Panel | Network and Internet ... >Please post any reply as a follow-up message in the news ...
    (microsoft.public.windowsxp.network_web)
  • Re: time-to-instantiation versus time-to-connect
    ... Every SQLConnection I instantiate is based on the same connection string: ... I assume connection pooling is in full force. ... connections many times during the server processing of a page-request. ...
    (microsoft.public.dotnet.framework.adonet)