Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make macro or evaluate expression
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
How to make macro or evaluate expression
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01525786
Message ID:
01525786
Views:
85
Hi,

I have been trying to create an expression to use with a macro or evaluate() function to do the following:

I want to SCAN through records of a VFP table and for each record execute SQLEXEC() function to add this record to the SQL Server table. The template of the expression is as following:
cExpr = "insert into MyTable (fld1, fld2, fld3) values (?fld1, ?fld2, ?fld3)"
*-- Then execute the expression
SQLEXEC(hCon,cExpr)	
The problem is that I can't create the expression such that I can execute it as following:
SELECT MyVfpTable
SCAN
      *-- the following does not work
      cExpr = &cExpr.
      *-- the following does not work either.
      cExpr = evaluate(cExpr) 
      SQLEXEC(hCon,cExpr)	
ENDSCAN
I would appreciate any suggestions on how to make this expression. TIA.




ENDSCAN
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform