i can't use movelast in ado

Hi guys
i can use ado connect to local .dbf and sql server and get the data from it.but i found i can't use movepriveous,movelast function of ado object and also i can't get the recordcount ,any idea?

o=CREATEOBJECT("adodb.connection")
o.ConnectionString="Provider=VFPOLEDB.1;Data Source=P:\test\data;Password='';Collating Sequence=MACHINE"
o.Open()
r=CREATEOBJECT("adodb.recordset")
r.Open("select * from freetable1",o)

?r.recordcount display -1
r.movelast show "OLE IDspatch exception code 0 from Miscrosoft OLE DB Provider for Visual Foxpro:Rowset does not suport fetching backward"

r.moveprevious show "OLE IDspatch exception code 0 from ADODB.Recordset:OPeration is not allowed in this context"

it's same problem when i connected to sql server
the second question is how can i bind the ado to the grid control?
thank you

[872 byte] By [jetsu] at [2008-2-14]
# 1

Hi,
You should try to use a client side cursor

o=CREATEOBJECT("adodb.connection")
o.ConnectionString="Provider=VFPOLEDB.1;Data Source=P:\test\data;Password='';Collating Sequence=MACHINE"
o.CursorLocation= 3 && adUseClient
o.Open()

Thierryp at 2007-9-8 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 2
Hi Thierryp
thank you,now i can move to the end.;-)
the second question is how can i bind the ado to the grid control?
thank you
jetsu at 2007-9-8 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 3

VFP controls can only be binded with Foxpro Cursors.
Use CursorAdapter (VFP8+) or remote views (but using ODBC instead of ADO).

Thierryp at 2007-9-8 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 4
ok.thank very much
jetsu at 2007-9-8 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...