E
Ed
I am using the following connection string to access a CSV file:
Dim ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& path & ";Extended Properties=""Text;HDR=Yes;FMT=Delimited\"""
Then to load the data:
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim daAllModels As New OleDb.OleDbDataAdapter("Select * from " & file,
conn)
daAllModels.Fill(dsAllModels, "TextFile")
The problem is "path" must be the full path to "file". I keep the
file in the same directory as the ASPX file that uses it. When I run
this on localhost I know the path to the file, but I do not know it
when I copy the project to my Internet host server. I can find the
current working directory on the host, but that is the Windows system
directory and I don't think I want to put the file there.
How can I specify the path?
thanks
Ed
Dim ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& path & ";Extended Properties=""Text;HDR=Yes;FMT=Delimited\"""
Then to load the data:
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim daAllModels As New OleDb.OleDbDataAdapter("Select * from " & file,
conn)
daAllModels.Fill(dsAllModels, "TextFile")
The problem is "path" must be the full path to "file". I keep the
file in the same directory as the ASPX file that uses it. When I run
this on localhost I know the path to the file, but I do not know it
when I copy the project to my Internet host server. I can find the
current working directory on the host, but that is the Windows system
directory and I don't think I want to put the file there.
How can I specify the path?
thanks
Ed