Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO & VFP
Message
From
04/03/1999 10:18:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
ADO & VFP
Miscellaneous
Thread ID:
00194021
Message ID:
00194021
Views:
49
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!!
Next
Reply
Map
View

Click here to load this message in the networking platform