PSUIVERSON
Technical User
I am in the process of replicating a monthly data conversion process which uses CLIPPER code and creates dBase files/tables. I am emulating it as VBA which creates tables in ACCESS. After one of the bigger tables is built I have to do a filter and output data from fields based on DEPT #'s into text format. I've done this and it's not a problem. However I am simply sending it out using OUTPUT and WRITE commands...
SAMPLE:
...
rst2.MoveFirst
rst.MoveFirst
Do While Not rst2.EOF
deptNo = rst2.Fields(0)
rst.Filter = "CDEPT='" & deptNo & "'"
Do While Not rst.EOF
'Simply change to the F: Drive when needed for SOM
Open "c:\download\Dept_TEST\" & deptNo & "\PDPTMAST.txt" For Append As #1
i = 0
For Each fld In rst.Fields
If IsNull(rst.Fields(i)) Then
rst.Fields(i) = " "
End If
fldValue(i) = rst.Fields(i)
Write #1, fldValue(i),
i = i + 1
Next
rst.MoveNext
Write #1, "NULL"
Close #1
Loop
rst2.MoveNext
Loop
...
* The question I have is that the old CLIPPER code sends this output out TWICE as SDF and DELIMITED. From what I can see my output is coming out as DELIMITED with comma's and in quites. I need to know how to;
1) Write in VBA export that writes using the SDF output file type.
These are the arguments and descriptions of the SDF and DELIMITED for CLIPPER, if this helps.
SDF specifies the output file type as a System Data Format ASCII
text file. Records and fields are fixed length.
DELIMITED specifies the output file type as a delimited ASCII text
file where character fields are enclosed in double quote marks (the
default delimiter). Records and fields are variable length.
Thanks
SAMPLE:
...
rst2.MoveFirst
rst.MoveFirst
Do While Not rst2.EOF
deptNo = rst2.Fields(0)
rst.Filter = "CDEPT='" & deptNo & "'"
Do While Not rst.EOF
'Simply change to the F: Drive when needed for SOM
Open "c:\download\Dept_TEST\" & deptNo & "\PDPTMAST.txt" For Append As #1
i = 0
For Each fld In rst.Fields
If IsNull(rst.Fields(i)) Then
rst.Fields(i) = " "
End If
fldValue(i) = rst.Fields(i)
Write #1, fldValue(i),
i = i + 1
Next
rst.MoveNext
Write #1, "NULL"
Close #1
Loop
rst2.MoveNext
Loop
...
* The question I have is that the old CLIPPER code sends this output out TWICE as SDF and DELIMITED. From what I can see my output is coming out as DELIMITED with comma's and in quites. I need to know how to;
1) Write in VBA export that writes using the SDF output file type.
These are the arguments and descriptions of the SDF and DELIMITED for CLIPPER, if this helps.
SDF specifies the output file type as a System Data Format ASCII
text file. Records and fields are fixed length.
DELIMITED specifies the output file type as a delimited ASCII text
file where character fields are enclosed in double quote marks (the
default delimiter). Records and fields are variable length.
Thanks