Local cCnString, oConn, oRS, cSql, cText oConn = CreateObject("ADODB.connection") oRS = CreateObject("ADODB.Recordset") *-- VFP free table ODBC connection string cCnString= "Driver=Microsoft Visual FoxPro Driver; " + ; "SourceType=DBf;SourceDB=c:\test;BackgroundFetch=No;" oConn.Open(cCnString) oRS.cursortype = 3 && adOpenStatic oRS.cursorlocation = 3 && adUseClient oRS.locktype = 3 && adLockOptimistic oRS.Open("select * from customer",oConn) *-- Disconnect cursor and reuse connection object *-- with SQL Server OLEDB connection string oRS.ActiveConnection = .null. Do while oConn.State=1 oConn.Close Enddo cCnString= "Provider=SQLOLEDB.1;"+; "Integrated Security=SSPI;"+; "Persist Security Info=False;"+; "Initial Catalog=mySQLTable;"+; "Data Source=mySQLServer" oConn.Open(cCnString) *-- Loop through recordset and write to SQL Server *-- using a sql statement. can be done w/ADO too cText = "Insert Into customer Values (" Do While Not oRS.EOF cSql = cText + Transform(oRS.Fields("custid").Value) + "," cSql = cSql + "'" + oRS.Fields("name").Value + "')" oConn.Execute(cSql,,128) && adExecuteNoRecords oRS.MoveNext EndDo oRS.Close oConn.Close