Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server Data Access With ADO
Message
De
25/11/1998 14:40:08
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
SQL Server Data Access With ADO
Divers
Thread ID:
00161540
Message ID:
00161540
Vues:
63
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform