Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare columns in two files 2

Status
Not open for further replies.

vbobby

Programmer
Oct 23, 2002
7
US
I need to compare columns(not all) in two files. what is the solution for this? can u read a file into a ADO recordset? How?
 
Not sure how to answer all of your question. Populating an ADO Recordset with data from a text file is possible. After instantiating a Recordset you can append fields as shown below


Set rs = New ADODB.Recordset

With rs
.Fields.Append "Value1", adVarChar, 100
.Fields.Append "Value2", adVarChar, 100
.Open
End With


After you have fields in your (disconnected Recordset) you can start dropping off data in the Recordset. I envision this bit of code inside a loop that’s reading your text file(s)

With rs
.AddNew
!Value1 = "Data From Text File1"
!Value2 = 'Data From Text File2"
.Update
End With

Does this help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top