Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADODB RecordSet RecordCount Question
Message
De
24/12/1999 15:50:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/12/1999 15:40:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00308445
Message ID:
00308446
Vues:
47
>I am using the following in VFP6 to pull records from a SQL Server 7 database.
>
>oConn=CREATEOBJECT("ADODB.Connection")
>WITH oConn
> .Provider = "SQLOLEDB.1"
> .ConnectionString = " Persist Security Info = False;User ID = sa;Initial Catalog = Portfolio;Data Source = SCM_TWO2"
> .Open
>ENDWITH
>
>lcselectstr = A very long SQL Statement
>oRs=CREATEOBJECT("ADODB.RecordSet")
>oRs.Open(lcselectstr,oConn,3,4)
>?oRs.RecordCount
>
>The data comes over just the way I want it but the RecordCount Property of the RecordSet Object returns a value of -1.
>Any ideas why this occurs?


If you don't set CursorType property it defaults to "forward only" cursor. With this type of cursors Recordcount returns -1.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform