Private Sub Convert_Click()
Dim rs As ADODB.Recordset
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
'using ADO and ODBC connect Foxpro database
conn.ConnectionString = "provider=msdasql;dsn=sycorax"
conn.Open
Debug.Print conn.ConnectionString
rs.Open "select * from tablename1 where date=2003-10-19 ", conn, adOpenStatic, adLockOptimistic
'rs.Filter = "date1= " & DTPicker1.Value
MousePointer = vbHourglass
Dim str As String
Do While Not rs.EOF
   str = str & "Tablename=mat_hdl_head_mod_associate,test_date=" & Format(rs(3), "d mmm yyyy") & ",tester_id=Hassoc02,Product=Sycorax,sw_version=1.5,set_part_id="
   str = str & rs(0) & "," & "ModuleA=" & rs(1) & "," & "ModuleB=" & rs(2) & ","
   str = str & Chr(13) & Chr(10)
   rs.MoveNext
Loop
Open Path + "c:\fox\text1.txt " For Output As 99
Print #99, str
Close 99
MousePointer = vbDefault
conn.Close
Set conn = Nothing
Set rs = Nothing
End Sub