T
tshad
I found that if I do a select from .csv file, it won't work if the filename
has "." or "-" in them such as:
PAYROLL.ALLOC.RPT_8511_3-15-07.CSV
I am doing the following:
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
path & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim da2 As New OleDb.OleDbDataAdapter("Select * from " &
"PAYROLL.ALLOC.RPT_8511_3-15-07.CSV", conn)
da2.Fill(DTDepartment)
If I replace 1st 2 periods (".") and dashes with underscores it works fine.
But this works:
If f.Exists(path & "PAYROLL.ALLOC.RPT_8511_3-15-07.CSV") Then
And this works:
objStreamWriter = New StreamWriter(
"PAYROLL.ALLOC.RPT_8511_3-15-07.CSV")
I assume that the periods and dashes are illegal characters for a file name
in the Select statement but why not in the other cases?
The problem is that I am getting this file from a Java system and that is
what they are calling their filename. Is there a way around this?
Thanks,
Tom
has "." or "-" in them such as:
PAYROLL.ALLOC.RPT_8511_3-15-07.CSV
I am doing the following:
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
path & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim da2 As New OleDb.OleDbDataAdapter("Select * from " &
"PAYROLL.ALLOC.RPT_8511_3-15-07.CSV", conn)
da2.Fill(DTDepartment)
If I replace 1st 2 periods (".") and dashes with underscores it works fine.
But this works:
If f.Exists(path & "PAYROLL.ALLOC.RPT_8511_3-15-07.CSV") Then
And this works:
objStreamWriter = New StreamWriter(
"PAYROLL.ALLOC.RPT_8511_3-15-07.CSV")
I assume that the periods and dashes are illegal characters for a file name
in the Select statement but why not in the other cases?
The problem is that I am getting this file from a Java system and that is
what they are calling their filename. Is there a way around this?
Thanks,
Tom