Re: Cannot clear ADO Errors
From: Mike T (anonymous_at_discussions.microsoft.com)
Date: 04/14/04
- Next message: AJ: "RE: Creating Access Tables with ADOX and "required" field parameter"
- Previous message: CJ Taylor: "Re: ADO (ActiveX) data binding to .NET Windows Form controls"
- In reply to: Val Mazur: "Re: Cannot clear ADO Errors"
- Messages sorted by: [ date ] [ thread ]
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!
>
- Next message: AJ: "RE: Creating Access Tables with ADOX and "required" field parameter"
- Previous message: CJ Taylor: "Re: ADO (ActiveX) data binding to .NET Windows Form controls"
- In reply to: Val Mazur: "Re: Cannot clear ADO Errors"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|