Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transferring records from a VFP table to an SQL Server t
Message
From
13/06/1998 12:50:41
 
 
To
13/06/1998 11:49:35
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00107856
Message ID:
00107867
Views:
17
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform