none
OLEDB Connectionstring for text file located @ FTP server RRS feed

  • Question

  • To All,

    I have a textfile located @ ftp server. I can download the file using FtpWebRequest. However I wanted to push whatever data in the text file located @ ftp to a certain sql table.

    My question is:

    1. Is it possible to connect to the ftp server using connection string my code below doesnt work.
      var fileName = string.Format("{0}{1}","ftp://hostname/remotedir","basefolder\\");

      string connectionString = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}; Extended Properties=""text;HDR=No;FMT=Delimited""", fileName);

    Of course I can download the text file to the local folder using ftpwebrequest and using the downloaded file I can push the data to the sql table. But, it is the last thing I would like to do because of some data integrity concerns.

    Hoping for some great thoughts and inputs.

    Thanks in advance,

    nutty


    nuttynuts
    • Moved by edhickey Wednesday, July 27, 2011 3:01 PM (From:.NET 3.0/3.5 Windows Workflow Foundation)
    Wednesday, July 27, 2011 6:21 AM

Answers

  • The Access/Jet OLEDB Providers only understand file reference protocols. You can use either a mapped drive letter or UNC path to the file.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, July 27, 2011 3:43 PM
  • Unless it's available through one of methods I mentioned, you will have to download the file to use the data access providers. If you want to stream the file from the FTP server then TCP/IP (System.Net.Sockets) might be an option.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, July 28, 2011 12:21 PM

All replies

  • The Access/Jet OLEDB Providers only understand file reference protocols. You can use either a mapped drive letter or UNC path to the file.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, July 27, 2011 3:43 PM
  • Paul,

    Thanks. my option really is to download the file from ftp to the server and work the from there?

    Any other alternative aside from downloading the file? say datastream? I haven't  tried it though.


    nuttynuts
    Thursday, July 28, 2011 1:30 AM
  • Unless it's available through one of methods I mentioned, you will have to download the file to use the data access providers. If you want to stream the file from the FTP server then TCP/IP (System.Net.Sockets) might be an option.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, July 28, 2011 12:21 PM