DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Bharat Guest

    sql server 7 query for reading flat text file through OLE DB

    Dear Sir,

    I am facing problem in reading flat text file throgh SQL 7 query analyser.
    My query is as follows

    select * from openrowset('DTSFlatFile'
    , 'Data Source=\\myserver\bosac7\t2.txt
    ;Mode=Read;Row Delimiter={LF};File Format=0;Column Delimiter=|
    ;File Type=1;Skip Rows=0;First Row Column Name=False
    ;Number of Column=0;Max characters per delimited column=255'
    ,'SELECT * ')

    error given is

    Server: Msg 7303, Level 16, State 2, Line 1
    Could not initialize data source object of OLE DB provider 'DTSFlatFile'.

    [OLE/DB provider returned message: Error opening datafile: The system cannot
    find the file specified.]

    content of text file T2 is

    ACC | S R Investment | 500.00
    REL | L R Trades | 300.00

    Please note that T2.TXT file existing in the same folder as specified in
    data source statement and
    despite correct path it is giving error.

    can u please give solution to the above problem

    pl reply to bharat@comtek-india.com, bcsangani@hotmail.com


    Bharat Sangani

  2. #2
    Michael Levy Guest

    Re: sql server 7 query for reading flat text file through OLE DB

    Make sure that the SQL Server service is not running under the LocalSystem
    account. Under the LocalSystem account, SQL Server will not be able to
    access resources on remote servers.

    Michael Levy MCDBA, MCSD, MCT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.