All,
It is possible and how can I, append the result of a recordset to a table.
I have a text file which is 60mb (weekly files) and for this particular system I only need about 25% of the records and 45% of the fields (the file has 73 fields!!!)
I figured I could query out the information and dump the result into a table for my compare, update etc.
Here is what I have:
I just at a loss on how to get the information into a table.
Any help would be must welcome.
Cheers,
It is possible and how can I, append the result of a recordset to a table.
I have a text file which is 60mb (weekly files) and for this particular system I only need about 25% of the records and 45% of the fields (the file has 73 fields!!!)
I figured I could query out the information and dump the result into a table for my compare, update etc.
Here is what I have:
Code:
Public Sub QueryTextFile()
Dim conn As New ADODB.Connection
Dim strConnection As String
Dim strPath As String
Dim rsFile6 As New ADODB.Recordset
Dim strFile6 As String
Dim qdf As QueryDef
Dim rd As rds.DataControl
strPath = "\\MyPath\September 06\"
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath & _
";Extended Properties='text;HDR=No;FMT=Delimited'"
conn.Open strConnection
strFile6 = strFile6 & "SELECT F13 , F14, F15, F16, F17, "
strFile6 = strFile6 & "F18, F19, F20, F21, F22, "
strFile6 = strFile6 & "F57, F58, F59, F60, F61, "
strFile6 = strFile6 & "F62, F63, F64, F65, F66, "
strFile6 = strFile6 & "F67, F68, F69, F70, F71, "
strFile6 = strFile6 & "F72, F73, F74 FROM MyFileName_20061205.csv "
strFile6 = strFile6 & "WHERE F13 LIKE 'U*' OR F13 IS NULL;"
.................................
Set conn = Nothing
End Sub
I just at a loss on how to get the information into a table.
Any help would be must welcome.
Cheers,