ClulessChris
IS-IT--Management
I've been running a varient for the following code to query 1 Excel workbook from another Excel work without problem for about 18 months. Now it's stopped reading the field 'Closed' (this is a date formatted column "dd/mm/yyyy hh:mm") although it will read other columns of the same format.
I'm totaly chasing my tail to see the bug. can you help?
Never knock on Death's door: ring the bell and run away! Death really hates that!
I'm totaly chasing my tail to see the bug. can you help?
Code:
Dim Conn As New ADODB.Connection
Dim oRS As New ADODB.Recordset
Dim sSQL As String
On Error Resume Next
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:/Temp/XLDump-091843.xls; " & _
"Extended Properties=""Excel 8.0;HDR=Yes;"";"
sSQL = "SELECT * " & _
"FROM [Sheet1$] " & _
"WHERE [Team Folder] ='Team E' "
oRS.Open sSQL, Conn, adOpenStatic, adLockOptimistic, adCmdText
Debug.Print oRS.RecordCount
Do Until oRS.EOF
Debug.Print oRS.Fields.Item("Closed")
oRS.MoveNext
Loop
oRS.Close
Never knock on Death's door: ring the bell and run away! Death really hates that!