Use a Transact-SQL statement in mssql2000 to process DBF Data Conversion
1. query DBF data
Select * From OpenDataSource ('vfpoledb', 'Data source = "D:/VFP/test. DBC" ')... test1
Select .*
From OpenRowSet ('msdasql ',
'Driver = {Microsoft Visual FoxPro driver };
Exclusive = no; collate = machine; deleted = yes; null = no;
Sourcedb = D:/VFP/test. dBc; sourcetype = dBc ;',
'Select * From test1') as
Select *
From OpenRowSet ('msdasql ', 'driver = Microsoft Visual FoxPro driver;
Sourcedb = D:/VFP/; sourcetype = dbf ',
'Select * From test3 ')
2. Import DBF data to MSSQL
Select * into test1 from OpenDataSource ('vfpoledb', 'Data source = "D:/VFP/test. DBC" ')... test1
3. Import SQL data into DBF
Insert into OpenRowSet ('msdasql ', 'driver = {Microsoft Visual FoxPro driver}; exclusive = no; collate = machine; deleted = yes; null = no; sourcedb = D: /VFP/test. dBc; sourcetype = dBc; ', 'select * From test1') Select * From test1
4. modify data
Update OpenRowSet ('msdasql ', 'driver = Microsoft Visual FoxPro driver; sourcedb = D:/VFP/; sourcetype = dbf ', 'select * From test3 where code = "11" ') Set Name =' "12 "'
The following are my methods for successful testing:
Select .*
From OpenRowSet ('msdasql ', 'driver = {Microsoft Visual FoxPro driver };
Exclusive = no; collate = machine; deleted = yes; null = no;
Sourcedb = D:/work/vf/data1.dbc; sourcetype = dBc ;',
'Select * From nsnew1000200.dbf') as
Select * From OpenRowSet ('msdasql ',
'Driver = Microsoft Visual FoxPro driver; sourcetype = DBF; sourcedb = D:/work/vf /',
'Select * from [nsnew1000200.dbf] ')
Select *
From OpenRowSet ('msdasql ', 'driver = Microsoft Visual FoxPro driver;
Sourcedb = D:/work/vf/; sourcetype = dbf ',
'Select * From nsnew1000200.dbf ')