Generally a .DAT file is not defined to mean anything specific and usually refers to a TXT file. On a related note, last week when I was in NOLA where our merry gang ate a place on Magazine St in the Garden District called
Dat Dog. Highly recommend it. Below is an example of creating and writing to a CSV log file:
DLM="," : QUO=CHR(34)
Set objFSO = CreateObject("Scripting.FileSystemObject")
CSVLogFile1 = oSession.PathTextout & oSession.CompanyCode & "-" & _
"SetElectronicConsentToNo-" & CurrentVBDateFullYMD & "-" & _
Replace(CurrentTime,":","-") & ".csv"
Set objFile1 = objFSO.CreateTextFile(CSVLogFile1, True) 'True means overwrite
sHdrRow = _
QUO & "Company" & QUO & DLM & QUO & sNow & QUO & DLM & QUO & "Division" & QUO & DLM & _
QUO & "VendorNo" & QUO & DLM & QUO & "Msg Type" & QUO & DLM & QUO & "Message" & QUO
objFile1.WriteLine sHdrRow
' blah blah blah ....
'Later within an AP_Vendor loop
rV = oVendor.GetValue("ElectronicConsentSigned1099$", ElectronicConsent)
r=oScript.DebugPrint("ElectronicConsent for " & CurrentVendor & " = " & ElectronicConsent)
If ElectronicConsent = "Y" Then
retVal = oVendor.SetValue("ElectronicConsentSigned1099$", "N")
If retVal = 0 Then
sMsgType = "Error on SetValue"
sMessage = oVendor.LastErrorMsg
End If
If retVal = -1 Then
sMsgType = "Warning on SetValue"
sMessage = oVendor.LastErrorMsg
End If
If retVal = 0 Then
sMsgType = "Passed"
sMessage = "Successful"
End If
sDataRow = _
QUO & sCompany & QUO & DLM & QUO & sNow & QUO & DLM & QUO & sVend & QUO & DLM & _
QUO & sVend & QUO & DLM & QUO & sMsgType & QUO & DLM & QUO & sMessage & QUO
objFile1.WriteLine sDataRow
rWrite = oVendor.Write()
' blah blah blah ....
End If
------------------------------
Alnoor Cassim
------------------------------