PROCEDURE SetConnection() LOCAL RetVal, OpenReturn, oException AS Exception This.oConnection=CREATEOBJECT("ADODB.connection") IF VARTYPE(This.oConnection)=="O" RetVal = .T. TRY WITH This.oConnection .Provider= "Advantage OLE DB Provider" .ConnectionString = "ServerType=ADS_LOCAL_SERVER" .Properties.Item["Data Source"].Value = This.Folder .Properties.Item["Advantage Server Type"].Value = "ADS_LOCAL_SERVER" OpenReturn = .Open() && Returns Null when successful, FWIW. ENDWITH CATCH TO oException This.Message = "Be sure you have installed this file: ADSOLEDB.EXE" + CRLF + oException.Message RetVal = .F. ENDTRY ELSE This.Message = "Unable to create the Connection to the Advantage tables." ENDIF RETURN m.RetVal ENDPROC PROCEDURE GetData() LOCAL FileName, Type, RecNo, VarType, Value, x WITH This.oRecordSet FOR EACH FileName IN This.aFileNames This.SetStatus("Opening file: " + m.FileName + "...") IF FILE( ADDBS(This.Folder) + m.FileName + ".ADT") .Open("Select * From " + m.FileName, This.oConnection) IF .State = 1 RecNo = 1 DO WHILE NOT .EOF FOR x = 0 TO .Fields.Count-1 FieldName = .Fields.Item[x].Name Type = .Fields.Item[x].Type VarType = VARTYPE(.Fields.Item[x].Value,.T.) Value = TRANSFORM(.Fields.Item[x].Value) INSERT INTO MyTable FROM MEMVAR ENDFOR .MoveNext() RecNo = m.RecNo + 1 ENDDO ENDIF .Close() ENDIF ENDFOR ENDWITH This.SetStatus("") RETURN ENDPROC