Well, I got past that. Now I'm trying to get this to work
---------------------------------
dim connection,recordset
dim sSQL,sConnString
dim Linecount
Const ForReading = 1, ForWriting = 2, ForAppending = 8
On Error Resume Next
Set objTextFileout = objFSO.CreateTextFile("C:\###\###" & "out.txt", 2)
'declare SQL statement that will query the database
sSQL="SELECT * FROM [Query - All Tasks]"
'define the connection string, specify database
'driver and the location of database
sConnString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=I:\###\###\errorlog.mdb"
Linecount = 0
Yesterday = DateAdd("d", -1, Date())
'create an ADO connection and recordset
Set connection = CreateObject("ADODB.Connection")
Set recordset = CreateObject("ADODB.Recordset")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Open the connection to the database
connection.Open sConnString
'Open the recordset object, execute the SQL statement
recordset.Open sSQL,connection
dateinfo = recordset("Date Found")
'first of all determine whether there are any records
'If Recordset.EOF Then
'wscript.echo No records returned.
'Else
'if there are records then loop through the fields
Do While Not recordset.EOF
condate = CDate(strDate)
Wscript.Echo dateinfo
wscript.echo yesterday
wscript.echo Linecount
If recordset = yesterday Then
Linecount = Linecount + 1
End IF
'move on to the next record
recordset.MoveNext
Loop
'End If
objTextFileout.WriteLine("Number of Issues yesterday were " & Linecount)
objTextFileout.Close
Recordset.Close
Connection.Close
Set Recordset = Nothing
Set Connection = Nothing
--------------------------------
All I'm trying to do is read a date record in a data base, compare it to a date (yesterday) and if it is the same increment a counter and then print a line to an out file.
I'm sure the 'If recordset = yesterday Then' line isn't correct but I'm not certain what else it should be.
Thank in advance,
John