i am exporting data into a text file with this code:
sSQL = "Select [EMPID], [WDATE], [WTYPE], [WHRS], [PCODE], [WRATE] From WHOURS WHERE PAYPER=" & rst.Fields(0).Value & ";"
Set rs4 = New adodb.Recordset
rs4.Open sSQL, objAccessConnection, adOpenKeyset, adLockPessimistic
I = rs4.RecordCount
If I > 0 Then
While Not rs4.EOF
veta = rs4.Fields(0).Value & "," & rs4.Fields(1).Value & " 0:00:00," & rs4.Fields(2).Value & "," & rs4.Fields(3).Value & "," & rs4.Fields(4).Value & "," & rs4.Fields(5).Value
Put ff, , veta
rs4.MoveNext
Wend
End If
Put ff, , veta
Close ff
and I am getting this text:
479,5/14/12 0:00:00,O/T,1,90,8.75
479,5/14/12 0:00:00,R/T,8,90,8.75
but I need format with apostrophes so it would be like:
"479",5/14/12 0:00:00,"O/T",1,"90",8.75
"479",5/14/12 0:00:00,"R/T",8,"90",8.75
can you please help me to fix this?
thanks
sSQL = "Select [EMPID], [WDATE], [WTYPE], [WHRS], [PCODE], [WRATE] From WHOURS WHERE PAYPER=" & rst.Fields(0).Value & ";"
Set rs4 = New adodb.Recordset
rs4.Open sSQL, objAccessConnection, adOpenKeyset, adLockPessimistic
I = rs4.RecordCount
If I > 0 Then
While Not rs4.EOF
veta = rs4.Fields(0).Value & "," & rs4.Fields(1).Value & " 0:00:00," & rs4.Fields(2).Value & "," & rs4.Fields(3).Value & "," & rs4.Fields(4).Value & "," & rs4.Fields(5).Value
Put ff, , veta
rs4.MoveNext
Wend
End If
Put ff, , veta
Close ff
and I am getting this text:
479,5/14/12 0:00:00,O/T,1,90,8.75
479,5/14/12 0:00:00,R/T,8,90,8.75
but I need format with apostrophes so it would be like:
"479",5/14/12 0:00:00,"O/T",1,"90",8.75
"479",5/14/12 0:00:00,"R/T",8,"90",8.75
can you please help me to fix this?
thanks