hi radhakrishnan,
U try this code this wil work correctly

Set rs = db.OpenRecordse t("select * from " & tablelst) ' tablelst-this is yr table name
tmp_val = ""
If Not rs.EOF Then
rs.MoveLast
rcount = rs.RecordCount
rs.MoveFirst
Close
Open App.Path & "\" & tablelst & ".txt" For Output As #1
For i = 0 To rs.Fields.Count...