Re: DeriveParameters and Jet OLEDB Provider



>From ADO.Command object:
<quote>
Using the Refresh method on a Command object's Parameters collection
retrieves provider-side parameter information for the stored procedure or
parameterized query specified in the Command object. The collection will be
empty for providers that do not support stored procedure calls or
parameterized queries.
<unquote>

>From OleDBCommandBuilder.DeriveParameters method:
<quote>
You can only use DeriveParameters with stored procedures. You cannot use
DeriveParameters to populate the OleDbParameterCollection with arbitrary
Transact-SQL statements, such as a parameterized SELECT statement.
<unquote>

In Jet a 'saved' query is not a stored procedure.


"Doug" <doug@xxxxxxxxxxxxxxxx> wrote in message
news:57F1EB53-5F0A-4A19-A52C-688D65AED9AE@xxxxxxxxxxxxxxxx
> Hi
>
> I've just discovered that the Jet OLEDB Provider does not support
> OleDbCommandBuilder.DeriveParameters, to discover the number and type of
> parameters expected by a Microsoft Access query.
>
> I'm a little surprised, as it was always possible to use the ADO Refresh
> method with this provider to populate a Paramters collection.
>
> Is there a reason for this? Is there a workaround?
>
> I know that it's an expensive operation which should be avoided anyway,
> but
> it's sometimes useful, and I'd like to use the same code against both
> Access
> and SQL Server.
>
> Thanks in advance.
>
> --
>
> Doug


.



Relevant Pages

  • Re: How to add adapters
    ... stored procedures to display all records and limited records if the query is ...     yourtable ... You also do not need one data adapter and one command object per query if ... to set it up is to place all of my code in the one stored procedure ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Calling Ingres Database Procedures through .Net Data Provider
    ... Provider reads the result set produced by that procedure just as any result set produced by a query. ... The .NET application would execute the procedure and read the result set ... stored procedure in a way that it is accepted with open arms into a DataSet. ...
    (comp.databases.ingres)
  • Re: Failed to get schema for this stored procedure
    ... Use the ExecuteNonQuery method of a command object when you have a ... query that does not return any rows. ... I don't believe the designer will ... >I'm trying to configure an SqlDataAdapter to a stored procedure that has no ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Finally which ORM tool?
    ... method used INSIDE the query is passed as the value immediately, ... That's also info not NEEDED to write correct queries on the ... Sequence and set aren't equal, true, but in this case, where linq ... to use the subquery train, I have to use joins, or rely on the provider ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Stored Procedures & Parameters Insert Problem
    ... Why use the MSDataShape provider? ... This is so that I can easily change the stored procedure in the sample ... an AutoNumber primary key field, and lngTestCount. ... Dim adoDBConn As ADODB.Connection ...
    (microsoft.public.data.ado)