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?
I can't complain but sometimes I still do - Joe Walsh