Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO returns 0 records
Message
De
09/09/1999 04:35:31
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00262739
Message ID:
00262760
Vues:
19
>I'm trying to get Ado working with some Fox databases and keep getting 0 records. The State for both the connection & recordset objects is 1 after the open. I'm using a System DSN pointing to the DBC.
>
>Here's the code:
>oConn = CreateObject("ADODB.Connection")
>oConn.Open("galsinc")
>oRS = CreateObject("ADODB.RecordSet")
>oRs.ActiveConnection = oConn
>oRs.Source = "SELECT * FROM Customers"
>oRs.Open
>?oRs.ReccordCount
>
>The last line always returns -1.
>
>Grrrr....

I ran a test recently using this code, which worked fine.
LOCAL lcCS, lcSQL, oField, rs

lcCS = "DSN=adotest;UID=;PWD=;"
lcSQL = 'SELECT * FROM Births where dob > {^1900-01-01 10:30:01 AM}'

rs = createobject("adodb.recordset")
rs.Open( lcSQL, lcCS, 1)

IF rs.RecordCount > 0
rs.MoveFirst
DO WHILE NOT rs.EOF
FOR EACH oField IN rs.Fields
? oField.Name, oField.Value
ENDFOR
rs.MoveNext
ENDDO
ENDIF

rs.close
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform