
Text import ISAM dysfunctional?
Hi, I hope someone will be able to help me!
I want to process and import data from the body of an e-mail message. I get
the "body text" by linking to my inbox and writing the body to a text file.
I have a linked table to this text file which I process line by line as a
recordset.
My problem: Certain messages link a number of lines into a single record in
the linked text file table. - Same messages - same places, different
messages - different places. 80% of the messages give no hassle. I've
checked that the lines have their "vbCrLf" (hex 0D 0A) - no problem there.
Is it the ISAM? Any solution
Public Function ProcessMSMessages(ByVal msgFrom As String, ByVal msgBody As
String) As Integer
On Error GoTo Error_ProcessMSMessages
Open conFileLocation & conMsgFileName For Output As #1
Print #1, msgBody
Close #1
DoEvents
Dim rstData As Recordset
Dim rstMS As Recordset
Dim qdfOrder As QueryDef
Dim intOrderNo As Integer
Dim strError As String
Dim strOrderNo As String
Set rstMS = CurrentDb.OpenRecordset("Main: Merchant Server", dbOpenDynaset)
Set rstData = CurrentDb.OpenRecordset("Data: Msg Body Text",
dbOpenSnapshot)
Set qdfOrder = CurrentDb.QueryDefs("Update Order Status")
Select Case msgFrom
rstOrder.AddNew
rstOrder![OrderReceived] = Now()
intOrderNo = rstOrder![OrderID]
'Find Merchant Server ID for new order
rstData.MoveFirst
If rstData![dataline] = "From:" Then
rstData.MoveNext
rstMS.FindFirst "[MSName] = '" & Trim(rstData![dataline]) & "'"
If Not rstMS.NoMatch Then
etc.