Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make macro or evaluate expression
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01525786
Message ID:
01525789
Views:
50
>>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.
>
>I don't understand what is the problem?
>This should work:
>
>cExpr = "insert into MyTable (fld1, fld2, fld3) values (?MyVfpTable.fld1, ?MyVfpTable.fld2, ?MyVfpTable.fld3)"
>SCAN
>    SQLEXEC(hCon,cExpr)
>ENDSCAN
>
Somehow when I was doing exactly what you showed in your example, I was getting error. Let me try again. thank you.
"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
Previous
Reply
Map
View

Click here to load this message in the networking platform