I have an Excel Comma seperated values file (A) and a macros file (B). On my machine B reads A perfectly but on another machine B does not read 2 columns which are formatted custom H:mm:ss.
Does anyone know why this would happen, or what I can do to fix it.This is a copy of the code I am using.
Set m_conXLS = CreateObject("ADODB.Connection")
Set m_rsXLS = CreateObject("ADODB.RecordSet")
Set rs = CreateObject("ADODB.RecordSet")
Set rs1 = CreateObject("ADODB.RecordSet")
sConnection = "DRIVER={Microsoft Excel Driver (*.xls)};DriverId=790;ReadOnly=True;DBQ=" & wbIT.Name & ";"
m_conXLS.Open sConnection
m_rsXLS.Open "SELECT * FROM [" & wbIT.Sheets(2).Name & "$]", m_conXLS
While Not m_rsXLS.EOF
If IsDate(m_rsXLS.fields(0)) Then
sSQL = "MCK_iqPhoneList '" & m_rsXLS.fields(0) & "','" & m_rsXLS.fields(1) & "','" & m_rsXLS.fields(2) & "'"
objConn.Execute sSQL
End If
m_rsXLS.movenext
Wend
m_rsXLS.fields(1) and m_rsXLS.fields(2) are fields that contain the time.for example below is what I am reading.
Jan 1, 2007 10:03:14 PM 10:03:36 PM
When I print the sSQL statement on my machine its shown as
'Jan 1, 2007','10:03:14 PM','10:03:36 PM'
but on the other machine is 'Jan 1, 2007','',''
thanks,
Does anyone know why this would happen, or what I can do to fix it.This is a copy of the code I am using.
Set m_conXLS = CreateObject("ADODB.Connection")
Set m_rsXLS = CreateObject("ADODB.RecordSet")
Set rs = CreateObject("ADODB.RecordSet")
Set rs1 = CreateObject("ADODB.RecordSet")
sConnection = "DRIVER={Microsoft Excel Driver (*.xls)};DriverId=790;ReadOnly=True;DBQ=" & wbIT.Name & ";"
m_conXLS.Open sConnection
m_rsXLS.Open "SELECT * FROM [" & wbIT.Sheets(2).Name & "$]", m_conXLS
While Not m_rsXLS.EOF
If IsDate(m_rsXLS.fields(0)) Then
sSQL = "MCK_iqPhoneList '" & m_rsXLS.fields(0) & "','" & m_rsXLS.fields(1) & "','" & m_rsXLS.fields(2) & "'"
objConn.Execute sSQL
End If
m_rsXLS.movenext
Wend
m_rsXLS.fields(1) and m_rsXLS.fields(2) are fields that contain the time.for example below is what I am reading.
Jan 1, 2007 10:03:14 PM 10:03:36 PM
When I print the sSQL statement on my machine its shown as
'Jan 1, 2007','10:03:14 PM','10:03:36 PM'
but on the other machine is 'Jan 1, 2007','',''
thanks,