Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make macro or evaluate expression
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01525786
Message ID:
01525791
Vues:
55
>>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
>
This was a case of the user error <g>. Thank you for your help!
"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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform