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:
01525824
Views:
41
I prefer to to it one record at a time since during the conversion I am sure I will find many records that would have to be discarded because they will break referential integrity. In my VFP database I didn't do a good job in maintaining this so conversion to SQL Server is painful (to say the least).

>If the table is not too big and you're using SQL Server 2005 and up, then I suggest to rather pass XML and insert as one the whole table.
>
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform