Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO & VFP
Message
 
À
04/03/1999 10:18:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00194021
Message ID:
00194092
Vues:
31
When you say it fails, what OLE-DB Error message do you get?

The following is a revised version of your code:

oConnection = CreateObject("ADODB.Connection")
oCommand = CreateObject("ADODB.Command")
With oConnection
.CursorLocation = 3 && Client-Side Cursor
.ConnectionString = "DATABASE=PROGLIB;DSN=DDHELP;UID=someone;PWD=;"
.Open
EndWith
With oCommand
.CommandText = "Select * from programs where rtrim(ltrim(progrm_key)) = ?"
oparameter = .CreateParameter("v_progkey",129,1,1,"1")
.Parameters.Append(oParameter)
.CommandType = 1
.ActiveConnection = oConnection
oRecordSet = .Execute
EndWith

?oRecordset.Fields.Count

For Each Field in oRecordset.Fields
?Field.Name,Field.Value
Next Field

For starters, if you are using SQL Server, I would HIGHLY recommend using the OLE-DB Provider, NOT the OLE-DB Provider for ODBC.

Things to verify:

1. The number of fields in the Recordset
2. The names of the fields in the Recordset


Good luck,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform