DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
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




    Thanks

    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.

    -Mike
    --
    Michael Levy MCDBA, MCSD, MCT
    michaell@gasullivan.com



Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links