Hi
Well, first at all
I am working under windows xp pro w/sp2 with all the latest updates
And Access 2003 w/SP2 also with the latest updates, I still do not
want to Install SP3 I have read the pacth still have problems...
I did the following
New Query in design view, SQL view and entered
Select DirHashFiles From TempData_Tbl
Finally Run
The tbl TempData_Tbl has 186 records
When I run the code you provide me I do not have any execution
problem, the .txt file is created but blank, no records, no data to
read
I have a similar problem like this post
http://groups.google.com/group/micr...77e0e/add6e070f44d1de4?hl=en#add6e070f44d1de4
The strange thing is the code Writes out a Temporal Report TXT file
'Writing out a Temporal Report TXT file:
'<Drive>:\<Drive> Report.txt OR
'<Drive>\Folder\FirstFolder Report.txt OR
'<Drive>:\Folder\Folder...\<Drive> FirstFolder TO LastFolder
Report.txt
'In order to add this file into the Hash File without user
intervention (Writing out a Temporal batch file)
Open TempTXTFile For Output As #egfFF
Print #egfFF, "============ 00/00/0000 00:00:00 AM/PM
============"
Print #egfFF, "-- Results --"
Print #egfFF, "Info"
Print #egfFF, "- date: 00/00/0000"
Print #egfFF, "- process: Hash"
Print #egfFF, "- source: <Drive>:\<Folder>"
Print #egfFF, "- source volume label: Volume Name"
Print #egfFF, ' Write blank line.
Print #egfFF, "Basic statistics"
Print #egfFF, "- time elapsed: 00:00:00"
Print #egfFF, "- overall transfer [kB/s]:
000000000000,000000000000"
Print #egfFF, "- folders processed: 000000000000"
Print #egfFF, "- files processed: 00000000000000"
Print #egfFF, "- source bytes read: 000000000000 MB
(000000000000,000000000000,000000000000 bytes)"
Print #egfFF, "- source average transfer [kB/s]:
000000000000,000000000000"
Print #egfFF, "- source clean transfer [kB/s]:
000000000000,000000000000"
Print #egfFF, ' Write blank line.
Print #egfFF, "Errors"
Print #egfFF, "- errors: 000000000000"
Print #egfFF, "- warnings: 0000000000"
Print #egfFF, "- other: 0000000000000"
Print #egfFF, ' Write blank line.
Print #egfFF, "-- Messages --"
Print #egfFF, "note;hash;Hash file created (code:
0000000000000);<Drive>:\<Folder>:\File.CRC"
Print #egfFF, "note;hash;Hash file created (code:
0000000000000);<Drive>:\<Folder>:\File.CRC"
Print #egfFF, "note;hash;Hash file created (code:
0000000000000);<Drive>:\<Folder>:\File.CRC"
Close #egfFF ' Close file.
-|The code Also writes a batch file
'Initialize New Event Writing_out_batch_file_CDCheck
'Initialize Variables
amcFF = FreeFile()
'Writing out a batch file (.bat or .vbs) using VBA
'Working and Tested Solution
'Determine IF is <Drive>:\ OR <Drive>:\Folder OR <Drive>:\Folder
\Folder...
'Please note: Very Sensitive if the user opens a file the hash
change
If MyCodeSelection = 1 Then
Open "C:\Program Files\Dups\Batch Files\HashIt.bat" For
Output As #amcFF
Print #amcFF, "CD /D " & Chr(34) & Environ("ProgramFiles")
& "\CDCheck" & Chr(34)
Print #amcFF, "START /WAIT CDCheck /CRC:MD5 " & Chr(34) &
GetFolder & Chr(34) & Chr(32) & _
"/O:" & Chr(34) & GetFolder & strDrive & ".CRC" & Chr(34)
& Chr(32) & _
"/SaveReport:" & Chr(34) & GetFolder & strDrive & "
Report" & ".txt" & Chr(34)
Close #amcFF
ElseIf MyCodeSelection = 2 Then
Without any problem
-|But with the code you provide
Sub WriteToTextFile()
'Reference
'Microsoft ActiveX Data Objects 2.8 Library.
Dim rs As New ADODB.Recordset
Dim dbCon As ADODB.Connection
'Dim dbCon As New ADODB.Connection
Dim fnum As Integer
On Error GoTo Err_Handler
Set dbCon = CurrentProject.Connection
'dbcon.Open (<please enter your connection string>)
rs.Open "Select DirHashFiles From TempData_Tbl", dbCon
fnum = FreeFile()
If rs.BOF = False Then
'open the text file
Open "c:\matias.txt" For Output As #fnum
rs.MoveFirst
Do Until rs.EOF
Print #fnum, DirHashFiles
rs.MoveNext
Loop
End If
Exit_Point:
Close
Exit Sub
Err_Handler:
MsgBox Err.Description, vbExclamation, "Error " & Err.Number
Resume Exit_Point
End Sub
I Still don't getting the result I need
What I am doing wrong????????
Please help!
Regards,
Antonio Macias