>I've created an SQL Server table 'groups' that matches my VFP table 'groups', problem is I haven't got a clue as to how to transfer the records from one to the other. Any help would be appreciated.
>Thanks
>Allen Burlingame
Hello, Allen!
You can transfer the records by using the views:
- Create an updatable view for SQL server table;
- and transfer the records from VFP table to the view:
by using following code:
************************************
* SCAN loop with SCATTER/GATHER
************************************
select groups && VFP table
scan
scatter name tmpVar
select yourViewName
gather name tmpVar
select groups && VFP table
endscan
************************************
or
************************************
* SCAN loop using INSERT-SQL
************************************
select groups && VFP table
scan
insert into vwGroups ([viewFieldName1][,viewFieldName2][...,viewFieldNameN]);
values ([FieldName1][,FieldName2][...,FieldNameN])
endscan
************************************
or
************************************
* COPY TO ARRAY and INSERT-SQL
************************************
select groups && VFP table
copy to array laTemp
insert into vwGroups from array laTemp
************************************
or
************************************
* APPEND from table
************************************
select yourViewName
append from groups.dbf && VFP table
************************************
And at the end use the following command to commit changes:
=TableUpdate(.t.) (See VFP help about using)
Also you can use SQL pass-through, an information about you can find in the VFP help (SQLConnect(), SQLExec(), etc).
Best regards
Alexander.
Alex