|
-
Apr 16th, 2001, 10:16 AM
#1
Thread Starter
Member
I'm running this Sql statement, and for some reason using the DAO method I'm getting Garbled data at the end of the file i'm outputting to. When I run the same exact statement using Crystal reports it works fine. The strange part is that the only output statements in my code formats the dates. But I get unformatted dates at the end of the output file.
Does anyone know if i'm diong something wrong?
Open "C:\Windows\Desktop\test.txt" For Output As #1
Set wrkODBC = CreateWorkspace("", "admin", "",
dbUseODBC)
Set conMAS90 = wrkODBC.OpenConnection("",
dbNoDriverPrompt, True, _
"ODBC;DATABASE=;COMPANY=RFS;UID=;PWD=;DSN=
SOTAMAS90;LOGINTIMEOUT=1")
Set rstTemp = conMAS90.OpenRecordset("SELECT ARN_InvHistoryHeader.CustomerNumber, ARN_InvHistoryHeader.InvoiceNumber, ARN_InvHistoryHeader.SOOrderDate, ARN_InvHistoryHeader.SOShipDate, ARN_InvHistoryHeader.SOSourceJournal, ARO_InvHistoryDetail.SOItemNumber, ARO_InvHistoryDetail.SOHasPriceBeenOverridden, ARO_InvHistoryDetail.SOQtyShipped, ARO_InvHistoryDetail.SOUnitPrice FROM ARN_InvHistoryHeader, ARO_InvHistoryDetail WHERE ARN_InvHistoryHeader.InvoiceNumber = ARO_InvHistoryDetail.InvoiceNumber AND ARN_InvHistoryHeader.HeaderSeqNumber = ARO_InvHIstoryDetail.HeaderSeqNumber AND ARN_InvHistoryHeader.AppFrom = 'SO' ORDER BY ARN_InvHistoryHeader.CustomerNumber, ARN_InvHistoryHeader.InvoiceNumber", dbOpenDynamic)
OpenRecordsetOutput rstTemp
Set rstTemp = conMAS90.OpenRecordset("ARN_InvHistoryHeader", _
dbOpenSnapshot, dbRunAsync)
OpenRecordsetOutput rstTemp
rstTemp.Close
conMAS90.Close
wrkODBC.Close
Close #1
End
End Sub
Sub OpenRecordsetOutput(rstOutput As Recordset)
With rstOutput
Do While Not .EOF
Print #1, Tab(0); .Fields(0); Tab(8); .Fields(1);
Tab(15); Format(.Fields(2), "YYYYMMDD");
Tab(23); Format(.Fields(3), "yyyymmdd");
Tab(31); .Fields(4); Tab(33); .Fields(5);
Tab(48); .Fields(6); Tab(49);
Format(.Fields(7), " 000000000.00;-000000000.00");
Tab(62);
Format(.Fields(8), " 000000000.00;-000000000.00");
.MoveNext
Loop
End With
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|