dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24

Thread: Operating system error code 3(The system cannot find the path specified.).

  1. #16
    Join Date
    Sep 2007
    Posts
    86
    ok, I know the problem Let's assume your uploaded file is going to live here:

    c:\inetpub\wwwroot\mysite\upload.txt

    You are telling your DB to do the following:

    BULK INSERT dialerresults FROM c:\inetpub\wwwroot\mysite\upload.txt WITH ( FIELDTERMINATOR = ',' , ROWTERMINATOR = '\n'

    Now, since the DB is on a different server it likely does not have the path c:\inetpub\wwwroot\mysite and even if it does it likely doesn't have an upload.txt file in it.

    To make this work you would need to setup your directory on your website as a shared folder and then give the DB user account access to that folder. Then you would tell the DB to use \\MyWebServer\MyShare\upload.txt.
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  2. #17
    Join Date
    Apr 2009
    Posts
    31
    So John,

    If I modify this line:

    Dim SaveLocation As String = Server.MapPath("Data") & "\upload.txt"

    to this:

    Dim SaveLocation As String = Server.MapPath("\\MSBWEB3\wwwroot\Webfile1\Data") & "\\MSBWEB3\wwwroot\Webfile1\Data\upload.txt"

    That should work?

  3. #18
    Join Date
    Sep 2007
    Posts
    86
    not exactly. Server.MapPath() will return a fixed path using the applications working directory so Server.MapPath("Data") is likely returning c:\inetpub\wwwroot\myapp\data.

    If you go into the filesystem and share wwwroot then yes you code change should work assuming your DB user has permissions to that share.
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  4. #19
    Join Date
    Apr 2009
    Posts
    31
    I enabled the sharing of the wwwroot on the web server and now I get this error:

    Could not find a part of the path 'C:\Inetpub\wwwroot\Webfile1\MSBWEB3\wwwroot\Webfile1\Data\MSBWEB3\wwwroot\Webfile1\Data\u pload.txt'.

    and when I ran debug I got this error:

    Failed to map the path '/MSBWEB3/wwwroot/Webfile1/Data'.

    What am I missing?

  5. #20
    Join Date
    Sep 2007
    Posts
    86
    it looks like you are still using Server.MapPath. You don't want to do this anymore since you are using a UNC pth now.

    Your code should set your path = "\\SERVERNAME\SHARE\upload.txt"
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  6. #21
    Join Date
    Apr 2009
    Posts
    31
    John,

    Thank you. That did it. Now I only have one more issue and that involves the file. The sample data I have has 4 lines of "data" but when I upload that to the SQL server, it only shows that 3 lines of data were uploaded:

    Here is the sample data:

    ,512 206 1293,rob stevens,doctor alexander,20100501 12:30,,
    ,512 555 1212,jason reed,doctor smith,20100505 1:00,,
    ,512 444 1111,sean jones,doctor paul,20100601 4:00,,
    ,512 111 1212,zach cochran,doctor stevens,20100605 3:15,,

    What's also odd is that the last field in the table is a "results" field that's supposed to be NULL but when the last line of the 3 lines of data that are being inserted into the database, the last result is not showing NULL but a box character. What do you think could be causing that?

    Thank you

    Doug

  7. #22
    Join Date
    Sep 2007
    Posts
    86
    I believe the reason you are only getting three is that you likely do not have a CRLF at the end of the 4th line. I could be wrong though as I'm not that deep in SQL. You may want to post the question to the database forum.
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  8. #23
    Join Date
    Apr 2009
    Posts
    31

    Thank you

    John,

    Seriously, thank you. This problem has been driving me nuts for a few weeks and you solved it in less than a day. I'm new to asp.net developing but with help from people like you, it makes things go a lot smoother and makes coding a lot less frustrating.

    Doug

  9. #24
    Join Date
    Apr 2009
    Posts
    31
    John,

    Ok you were right about the crlf at the end of line 3. I edited that and that works fine now but it appears that the data is being double inserted. Can you see as to why that would be?

Similar Threads

  1. Replies: 0
    Last Post: 10-09-2001, 08:40 AM
  2. Find Dialog - Set the "Look In" path.....
    By Crispin Wright in forum VB Classic
    Replies: 2
    Last Post: 08-26-2001, 06:08 PM
  3. java path
    By feroz in forum Java
    Replies: 1
    Last Post: 05-03-2001, 09:03 AM
  4. ACCESS THE REGISTRY & FIND THE PATH
    By SINNI in forum VB Classic
    Replies: 0
    Last Post: 03-21-2001, 09:00 AM
  5. ACCESS THE REGISTRY & FIND THE PATH
    By SINNI in forum VB Classic
    Replies: 0
    Last Post: 03-21-2001, 09:00 AM

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


   Development Centers

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