Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO & VFP
Message
De
04/03/1999 10:18:14
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
ADO & VFP
Divers
Thread ID:
00194021
Message ID:
00194021
Vues:
51
I'm trying to access some of my fox stuff using ADO with SQL Server. It would seem that I'v run into a problem. Here's the little piece of code I'm using:
v_progkey = "1"
GetProg = "Select * from programs where rtrim(ltrim(progrm_key)) = '"+v_progkey+"'"
dbobj = createobject("ADODB.Connection")
dbobj.open("DATABASE=PROGLIB;DSN=DDHELP;UID=someone;PWD=;")
Prog = dbobj.execute(GetProg)
stepkeyval = Prog.Fields("steps_key").value
? Prog.Fields("progdesc").value
? "Criteria:"
? ltrim(Prog.Fields("condition").value)
? ltrim(Prog.Fields("objective").value)
? ltrim(Prog.Fields("criteria").value)
? ltrim(Prog.Fields("domain_key").value)
When I execute this code.. All lines below '? "Criteria:"' fail. IF I remove the line 'stepkeyval = Prog.Fields("steps_key").value' it works again. I also tried building multiple recordsets and when I do that it fails as well.
The SQL table structure:
progdesc   - char    - 35 - nulls=Yes
condition  - varchar - 66 - nulls=Yes
objective  - varchar - 66 - nulls=Yes
criteria   - varchar - 66 - nulls=Yes
domain_key - char    - 6  - nulls=Yes
I've changed the fields from varchar to char and back again. The reason I'm using ADO is for portability. I may want to reuse this code in another language later (VB, ASP, etc..) and the code for all the should be pretty similar. Can anyone give me any info on what I'm doing wrong? or is ADO broke? TIA!!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform