Microsoft.Jet text file query

Discussion in 'ASP .Net' started by Simple Simon, Dec 5, 2003.

  1. Simple Simon

    Simple Simon Guest

    I'm trying to read a CSV file that happens to have some spaces in
    it...(Land - Lot.csv) For some reason, the SQL statement can't find
    the file...ne1?

    // CSV file connection
    strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=c:\\Temp;Extended Properties=\"Text;HDR=YES;FTM=Delimited\"";
    OleDbConnection oleCon = new OleDbConnection(strCon);
    oleCon.Open();

    strSQL = "SELECT * FROM Land - Lot.csv";
    OleDbDataAdapter daRead = new OleDbDataAdapter(strSQL, oleCon);


    TIA,
    ~Gordon
    Simple Simon, Dec 5, 2003
    #1
    1. Advertising

  2. Hi Gordon,

    Try using brackets around the file in the SQL Statement: [Land - Lot.csv]

    Alex Papadimoulis
    "Simple Simon" <> wrote in message
    news:...
    > I'm trying to read a CSV file that happens to have some spaces in
    > it...(Land - Lot.csv) For some reason, the SQL statement can't find
    > the file...ne1?
    >
    > // CSV file connection
    > strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > Source=c:\\Temp;Extended Properties=\"Text;HDR=YES;FTM=Delimited\"";
    > OleDbConnection oleCon = new OleDbConnection(strCon);
    > oleCon.Open();
    >
    > strSQL = "SELECT * FROM Land - Lot.csv";
    > OleDbDataAdapter daRead = new OleDbDataAdapter(strSQL, oleCon);
    >
    >
    > TIA,
    > ~Gordon
    Alex Papadimoulis, Dec 5, 2003
    #2
    1. Advertising

  3. Simple Simon

    Simple Simon Guest

    Hi Alex,
    Thxs for replying...No go :(

    ~Gordon

    On Fri, 5 Dec 2003 16:07:21 -0500, "Alex Papadimoulis"
    <alexp-at-halogenstudios.com> wrote:

    >Hi Gordon,
    >
    >Try using brackets around the file in the SQL Statement: [Land - Lot.csv]
    >
    >Alex Papadimoulis
    >"Simple Simon" <> wrote in message
    >news:...
    >> I'm trying to read a CSV file that happens to have some spaces in
    >> it...(Land - Lot.csv) For some reason, the SQL statement can't find
    >> the file...ne1?
    >>
    >> // CSV file connection
    >> strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data
    >> Source=c:\\Temp;Extended Properties=\"Text;HDR=YES;FTM=Delimited\"";
    >> OleDbConnection oleCon = new OleDbConnection(strCon);
    >> oleCon.Open();
    >>
    >> strSQL = "SELECT * FROM Land - Lot.csv";
    >> OleDbDataAdapter daRead = new OleDbDataAdapter(strSQL, oleCon);
    >>
    >>
    >> TIA,
    >> ~Gordon

    >
    Simple Simon, Dec 5, 2003
    #3
  4. Simple Simon

    Simple Simon Guest

    Wait! It does work...sorry, I forgot to update the filename in my
    schema.ini file.

    Thank you!

    On Fri, 5 Dec 2003 16:07:21 -0500, "Alex Papadimoulis"
    <alexp-at-halogenstudios.com> wrote:

    >Hi Gordon,
    >
    >Try using brackets around the file in the SQL Statement: [Land - Lot.csv]
    >
    >Alex Papadimoulis
    >"Simple Simon" <> wrote in message
    >news:...
    >> I'm trying to read a CSV file that happens to have some spaces in
    >> it...(Land - Lot.csv) For some reason, the SQL statement can't find
    >> the file...ne1?
    >>
    >> // CSV file connection
    >> strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data
    >> Source=c:\\Temp;Extended Properties=\"Text;HDR=YES;FTM=Delimited\"";
    >> OleDbConnection oleCon = new OleDbConnection(strCon);
    >> oleCon.Open();
    >>
    >> strSQL = "SELECT * FROM Land - Lot.csv";
    >> OleDbDataAdapter daRead = new OleDbDataAdapter(strSQL, oleCon);
    >>
    >>
    >> TIA,
    >> ~Gordon

    >
    Simple Simon, Dec 5, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2ZQ==?=

    The Microsoft Jet database engine cannot open the file

    =?Utf-8?B?RGF2ZQ==?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    948
    =?Utf-8?B?RGF2ZQ==?=
    Aug 5, 2005
  2. =?Utf-8?B?TmVhbA==?=
    Replies:
    3
    Views:
    41,603
    Paul Clement
    Sep 2, 2005
  3. Morten Wennevik
    Replies:
    1
    Views:
    3,107
    Morten Wennevik
    Oct 31, 2005
  4. Replies:
    2
    Views:
    5,802
    Paul Clement
    Dec 30, 2005
  5. Jas
    Replies:
    1
    Views:
    945
    Patrice
    Jan 25, 2010
Loading...

Share This Page