So I set up a loop to go through each line, pick the name and true/false out of the line (name and true/false are always in same place in line).
If the line says 'True' then I update a field named Contacted in a table called Contacts inside my database to be 'Yes'. I find the entry to be updated by saying where id is say '12345678910' and update that. So it does this one at a time and takes forever.
I think I could use recordsets instead and it would be much faster, but I am not sure if this would update the table itself? I appreciate any help you all can give on this.
Here is the code I am currently using.
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Open the text file for reading
Set objFile = objFSO.OpenTextFile("C:\TextFile.txt")
'Loop through the lines in the file
Dim StrLine As String
Dim Check As String
Dim T As String
Dim F As String
Dim mySQL As String
Dim Contactname as String
If Check = T Then
Contactname = Mid(StrLine, 61, 5) & Mid(StrLine, 69, 3)
mySQL = "UPDATE CONTACTS"
mySQL = mySQL & " SET CONTACTS.Contacted = Yes"
mySQL = mySQL & " WHERE (Instr([ACC_ID]," & Contactname & ")>0)"
Why not just import the ContactID and True/False values into a table? Then run an update query to change the value of 'Contacted' in tblContacts to the True/False value in the new table. Considering that you're dealing with a massive number of records, running one large update query will be much more efficient than looping through a recordset.