Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String too long to fit
Message
From
05/02/2007 13:50:20
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
01192359
Message ID:
01192520
Views:
15
>Hi all,
>
>I want to make a query from a long string but I get an error "string too long to fit". I was wondering how you are dealing with this in vfp 5. I have the following code:
>
>_text = fcreate("temp.txt")
>text
>Sum(vvp_pri) as vvp_pri,;
[SNIP]
>	sum(uitk_ao2) as uitk_ao2,;
>	sum(huitk_ao2) as huitk_ao2,;
>	ind_pvmak;
>endtext
>nSize =  FSEEK(_text, 0, 2)
>fseek(_text,0,0)
>cVelden = fread(_text,nSize)
>=fclose(_text)
>
>select cVelden from portefeuille_ulk_prov_pvp_prem_uitk7
>
The trouble is in the last line - it should be "select &cVelden from...", but even then, you may better use textmerge to make that into a .prg, with
set textmerge on
text to tmp.prg
select <<cVelden>> from portefeuille_ulk_prov_pvp_prem_uitk7
endtext
compile tmp.prg
do tmp
But under VFP5 you don't have the compile command - it was introduced in VFP6SP4, IIRC, so you'd have to run a macro at some point, and I'm not sure what were the limitations to a macro expanded code under VFP5. Just try "select &cVelden from...", if it works, OK, if not, just force the bosses to fork a few hundred bucks and upgrade straight to VFP9.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform