I am trying to use ADO to retrieve data from SQL Server 6.5 to populate ADO record sets instead of using Remote Views in an NTier implementation where the UI may be Fox, or VC++, or possibly even across the Web. Everything works fine until I try to open the record set. When I try to open the record set I either get an OLE Dispatch Error #0, or I get a record set with no records. The test code appears below. If anyone has any thoughts on the subject I would appreciate it.
Thanks
Jason Tryon
*********************************************************************
public oConnect, oRecSet
*/ Create and open the connection
oConnect = CreateObject("adodb.connection")
oConnect.Open("MYBOOKLIST")
cSQL = "Select * From booklist"
*/ Create and open the recordset
oRecSet = CreateObject("adodb.recordset")
oRecSet.CursorLocation = 3
*/oRecSet.Open(cSQL,oConnect,3,3) (Generates OLE Dispatch Error)
oRecSet = oConnect.Execute(cSQL) && Generates a recordset with no records
For nIncr = 0 To oRecSet.Fields.Count - 1
? Padr("Field Name = " + oRecSet.Fields(nIncr).Name,35) ;
+ " | Field Type = " + Alltrim(Str(oRecSet.Fields(nIncr).Type))
EndFor
?
? "Record Count = " + Alltrim(Str(oRecSet.RecordCount))
********************************************************************
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage