Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Getting SQL Tables With CursorAdapter
Message
De
19/11/2003 01:38:00
 
 
À
17/11/2003 13:39:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00850714
Message ID:
00851289
Vues:
8
This message has been marked as the solution to the initial question of the thread.
Hi Brian,

CursorAdapter is unable to handle ADO data types for three last columns in the recordset. I believe, they are not in the list of supported data types in "Data Type Conversion Control" help topic either.

Thanks,
Aleksey.


>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
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform