Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO to cursoradapter - multiple result sets
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
ADO to cursoradapter - multiple result sets
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01146187
Message ID:
01146187
Views:
76
Background: We have our main database on 64Bit SQL 2005 Server SP1 on Win2003 x64 (migrated recently from SQL 2000 on 32 bit Windows Server 2000).
we have been having an intermittent problem running a SQL stored procedure from VFP9. The SP returns 6 result sets with varying numbers of records/set. The SP works fine - generally took around 4 seconds to execute on SQL 2000 and 2 seconds on 2005. It ALWAYS works fine when run from SQL management studio. When we SQLEXEC this from VFP using ODBC standard SQL Server driver 99% of the time it works fine. The other 1 percent of the time it will hang during execution - VFP hangs until SQL timeout. Same exact query runs fine in Management Studio. Wait a while and it will eventually work in VFP..?? This happens with both the SQL2000 and SQL2005 servers.

Anyway I've just about given up trying to fix this (tried turning off batch mode, changing packet size, making SP recompile every execution, other stuff). I'm now trying to switch this over to using ADO to see if that is more reliable. ADO with VFP is new to me so I've been digging through here and through ADO help in MSDN but remain stuck.

I can create a basic ADO recordset with a command that returns a single result set, populate it, and load it to a cursor..

ors1=CREATEOBJECT("ADODB.Recordset")
ors1.open("select top 20 * from persons","Provider=SQLOLEDB.1;Initial Catalog=MDP;Data Source=TRUMAN;User ID = BillKuhn;Password=something;",3,1)
oca2=CREATEOBJECT("cursoradapter")
oca2.Alias = "myalias"
oca2.DataSourceType = "ADO"
oca2.CursorFill(,,,ors1)
BROWSE

That works fine.

Trying the same thing with my Stored procedure (the one that returns 6 result sets) works up until I try to fill the cursoradapter. Nothing happens. No cursor. No error.
The ors1 recordset has data - ors1.Fields(0).Value shows me valid field data.
If I try ors1=ors1.NextRecordset to jump to the next result set, ors1.Fields(0).Value shows me valid data for the next result set. Cursorfill still does nothing.

Am I doing something completely stupid (probably)?
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Next
Reply
Map
View

Click here to load this message in the networking platform