Resumen Creacion de consulta en Access 2000

Mensaje enviado por AVernieri@juncalnet.com.ar

Hola!

Como estas usando una sentencia SQL, seguramente te queda en la colección "Procedures" en vez de la "Views"...

Mirá la nota de la MSDN a pie del método "Append" de la colección Views...

If the command text that the user specifies represents a procedure rather than a view, the behavior is dependent upon the provider. Append will fail if the provider does not support persisting commands.

Note: When using the OLE DB Provider for Microsoft Jet, the Views collection Append method will allow you to specify a Procedure rather than a View in the Command parameter. The Procedure will be added to the data source and will be added to the Views collection. After the Append, if the Procedures and Views collections are refreshed, the Procedure will no longer be in the Views collection and will appear in the Procedures collection.

Saludos
Alberto


>>> Grupo Juncal.Notes."\"German Salvia\" <german@tec.com.ar>@BNL" 20/09/01
13:01 >>>
Me pasa algo medio extraño:
Tengo que crear por codigo una consulta en un mdb de access 2000
cuando lo hacia por DAO no habia problemas.
ahora que estoy usando ADO creo la consulta como MSDN manda:
Sub ADOCreateQuery()
    Dim cat As New ADOX.Catalog
    Dim cmd As New ADODB.Command
    ' Open the catalog
    cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=MiBase.mdb;"
    ' Create the query
    cmd.CommandText = "SELECT * FROM CUENTAS"
    cat.Views.Append "AllCuentas", cmd
    Set cat = Nothing
End Sub

    y resulta que cuando abro la base por access, entre las consultas no
aparece.
    la puedo usar, y si por ejemplo quiero hacer un informe referenciado a
esa consulta, anda bien. Pero si la quiero ver dentro de access en diseño,
es como si no existiera.

Si a alguien le paso algo parecido o sabe como solucionarlo, agradecido.

Saludos, german



Resumen Resumen

Visual Basic Página de Visual Basic

Página principal Página principal

www.jrubi.com