Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Getting SQL Tables With CursorAdapter
Message
De
17/11/2003 13:39:40
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Problem Getting SQL Tables With CursorAdapter
Divers
Thread ID:
00850714
Message ID:
00850714
Vues:
58
Hello,

Does anyone know why trying to get a cursor of SQL Server tables using oConn.OpenSchema would fail when using an ADO CursorAdapter? The following returns a "Data type mismatch" when calling CursorFill()...

Thanks,

- Brian
    lcConnString = 'Provider=SQLOLEDB.1;' ;
                 + 'Persist Security Info=False;' ;
                 + 'Integrated Security=SSPI;' ;
                 + 'Initial Catalog=Northwind;' ;
                 + 'Data Source=(local)'

    * Make an OLEDB connection
    goConn = CREATEOBJECT("ADODB.Connection")
    goConn.ConnectionString = lcConnString
    goConn.ConnectionTimeout = 30
    
    * Make sure cursors are client-side
    goConn.CursorLocation = 3  && adUseClient
    goConn.Open()

    LOCAL ARRAY laADCRIT[4]
    LOCAL loSchemaRS as ADODB.Recordset
    #DEFINE adSchemaTables 20

    laADCRIT    = .NULL.
    laADCRIT[4] = "TABLE"

    loSchemaRS  = goConn.OpenSchema(adSchemaTables, @laADCRIT)

    loCA = CREATEOBJECT("CursorAdapter")
    loCA.Alias           = "csrSQLTbls"
    loCA.DataSourceType  = "ADO"
    loCA.DataSource      = loSchemaRS
    loCA.BufferModeOverride = 5
    lbOk = loCA.CursorFill( .F., .F., 0, loSchemaRS )
    IF NOT lbOk
        AERROR(laErr)
        MESSAGEBOX("Error: " + TRANSFORM(laErr[1,2]))
    ENDIF
    
    loCA.CursorDetach()

    IF USED("csrSQLTbls")
        BROWSE FIELDS table_name
    ENDIF


VFP6 SP5, VFP8 SP1, VFP 9 SP 1 and Win XP SP 3 (unless otherwise specified)


www.wulfsden.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform