Connecting to FoxPro from .NET

Discussion in 'ASP .Net' started by z71mdridin, Jan 3, 2008.

  1. z71mdridin

    z71mdridin Guest

    I have an asp.net website that uses Form authentication to
    authenticate users. I need to provide users with a report based on
    FoxPro data that resides on a remote server. When I attempt to
    connect to the Foxpro directory by using the ODBC DSN that we
    currently use in ColdFusion, I get the following message:

    ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    does not exist.

    I know this is probably a permissions issue because asp.net is being
    run under a local username. I don't want to have to setup the aspnet
    username on the remote server and manually manage passwords, and I
    don't want to set up all web users names on the remote server.
    I already have a specific user 'webuser' that has access rights to
    both the webserver and the foxpro remote directory and would like to
    make use of this existing user to connect from .NET.

    Is there a way to connect to this FoxPro directory by specifying a
    username password with the connection string?
     
    z71mdridin, Jan 3, 2008
    #1
    1. Advertising

  2. z71mdridin

    Mike Guest

    this may help

    http://connectionstrings.com/

    http://connectionstrings.com/?carrier=visualfoxpro



    "z71mdridin" <> wrote in message
    news:...
    >I have an asp.net website that uses Form authentication to
    > authenticate users. I need to provide users with a report based on
    > FoxPro data that resides on a remote server. When I attempt to
    > connect to the Foxpro directory by using the ODBC DSN that we
    > currently use in ColdFusion, I get the following message:
    >
    > ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    > does not exist.
    >
    > I know this is probably a permissions issue because asp.net is being
    > run under a local username. I don't want to have to setup the aspnet
    > username on the remote server and manually manage passwords, and I
    > don't want to set up all web users names on the remote server.
    > I already have a specific user 'webuser' that has access rights to
    > both the webserver and the foxpro remote directory and would like to
    > make use of this existing user to connect from .NET.
    >
    > Is there a way to connect to this FoxPro directory by specifying a
    > username password with the connection string?
     
    Mike, Jan 3, 2008
    #2
    1. Advertising

  3. z71mdridin

    z71mdridin Guest

    Yeah, I have already tried looking there. My connection string is as
    follows:
    Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\
    \remoteServer\foxPro\Data;Exclusive=No;
    Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;

    but I still get the error message:
    System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    FoxPro Driver]File 'table.dbf' does not exist.

    On Jan 3, 2:27 pm, "Mike" <> wrote:
    > this may help
    >
    > http://connectionstrings.com/
    >
    > http://connectionstrings.com/?carrier=visualfoxpro
    >
    > "z71mdridin" <> wrote in message
    >
    > news:...
    >
    > >I have an asp.net website that uses Form authentication to
    > > authenticate users. I need to provide users with a report based on
    > > FoxPro data that resides on a remote server. When I attempt to
    > > connect to the Foxpro directory by using the ODBC DSN that we
    > > currently use in ColdFusion, I get the following message:

    >
    > > ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    > > does not exist.

    >
    > > I know this is probably a permissions issue because asp.net is being
    > > run under a local username. I don't want to have to setup the aspnet
    > > username on the remote server and manually manage passwords, and I
    > > don't want to set up all web users names on the remote server.
    > > I already have a specific user 'webuser' that has access rights to
    > > both the webserver and the foxpro remote directory and would like to
    > > make use of this existing user to connect from .NET.

    >
    > > Is there a way to connect to this FoxPro directory by specifying a
    > > username password with the connection string?
     
    z71mdridin, Jan 3, 2008
    #3
  4. z71mdridin

    z71mdridin Guest

    Anybody have any other suggestions?
    On Jan 3, 2:49 pm, z71mdridin <> wrote:
    > Yeah, I have already tried looking there. My connection string is as
    > follows:
    > Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\
    > \remoteServer\foxPro\Data;Exclusive=No;
    > Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;
    >
    > but I still get the error message:
    > System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    > FoxPro Driver]File 'table.dbf' does not exist.
    >
    > On Jan 3, 2:27 pm, "Mike" <> wrote:
    >
    > > this may help

    >
    > >http://connectionstrings.com/

    >
    > >http://connectionstrings.com/?carrier=visualfoxpro

    >
    > > "z71mdridin" <> wrote in message

    >
    > >news:...

    >
    > > >I have an asp.net website that uses Form authentication to
    > > > authenticate users. I need to provide users with a report based on
    > > > FoxPro data that resides on a remote server. When I attempt to
    > > > connect to the Foxpro directory by using the ODBC DSN that we
    > > > currently use in ColdFusion, I get the following message:

    >
    > > > ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    > > > does not exist.

    >
    > > > I know this is probably a permissions issue because asp.net is being
    > > > run under a local username. I don't want to have to setup the aspnet
    > > > username on the remote server and manually manage passwords, and I
    > > > don't want to set up all web users names on the remote server.
    > > > I already have a specific user 'webuser' that has access rights to
    > > > both the webserver and the foxpro remote directory and would like to
    > > > make use of this existing user to connect from .NET.

    >
    > > > Is there a way to connect to this FoxPro directory by specifying a
    > > > username password with the connection string?
     
    z71mdridin, Jan 4, 2008
    #4
  5. z71mdridin

    Mike Guest

    Does your table 'table.dbf' exist? Did you give your ID or ASPNET ID
    permission to the FoxPro database?


    "z71mdridin" <> wrote in message
    news:...
    > Anybody have any other suggestions?
    > On Jan 3, 2:49 pm, z71mdridin <> wrote:
    >> Yeah, I have already tried looking there. My connection string is as
    >> follows:
    >> Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\
    >> \remoteServer\foxPro\Data;Exclusive=No;
    >> Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;
    >>
    >> but I still get the error message:
    >> System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    >> FoxPro Driver]File 'table.dbf' does not exist.
    >>
    >> On Jan 3, 2:27 pm, "Mike" <> wrote:
    >>
    >> > this may help

    >>
    >> >http://connectionstrings.com/

    >>
    >> >http://connectionstrings.com/?carrier=visualfoxpro

    >>
    >> > "z71mdridin" <> wrote in message

    >>
    >> >news:...

    >>
    >> > >I have an asp.net website that uses Form authentication to
    >> > > authenticate users. I need to provide users with a report based on
    >> > > FoxPro data that resides on a remote server. When I attempt to
    >> > > connect to the Foxpro directory by using the ODBC DSN that we
    >> > > currently use in ColdFusion, I get the following message:

    >>
    >> > > ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    >> > > does not exist.

    >>
    >> > > I know this is probably a permissions issue because asp.net is being
    >> > > run under a local username. I don't want to have to setup the aspnet
    >> > > username on the remote server and manually manage passwords, and I
    >> > > don't want to set up all web users names on the remote server.
    >> > > I already have a specific user 'webuser' that has access rights to
    >> > > both the webserver and the foxpro remote directory and would like to
    >> > > make use of this existing user to connect from .NET.

    >>
    >> > > Is there a way to connect to this FoxPro directory by specifying a
    >> > > username password with the connection string?

    >
     
    Mike, Jan 4, 2008
    #5
  6. re:
    !> My connection string is as follows:
    ....snip...
    !> but I still get the error message:
    !> System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    !> FoxPro Driver]File 'table.dbf' does not exist

    That's a permissions problem.

    You are accessing "table.dbf" at a remote server, but the account ASP.NET
    uses to access the file doesn't have access permissions to "table.dbf".

    You need to have ASP.NET impersonate a network account which
    has the necessary permissions to access the "table.dbf" resource.





    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "z71mdridin" <> wrote in message
    news:...
    > Yeah, I have already tried looking there. My connection string is as
    > follows:
    > Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\
    > \remoteServer\foxPro\Data;Exclusive=No;
    > Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;
    >
    > but I still get the error message:
    > System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    > FoxPro Driver]File 'table.dbf' does not exist.
    >
    > On Jan 3, 2:27 pm, "Mike" <> wrote:
    >> this may help
    >>
    >> http://connectionstrings.com/
    >>
    >> http://connectionstrings.com/?carrier=visualfoxpro
    >>
    >> "z71mdridin" <> wrote in message
    >>
    >> news:...
    >>
    >> >I have an asp.net website that uses Form authentication to
    >> > authenticate users. I need to provide users with a report based on
    >> > FoxPro data that resides on a remote server. When I attempt to
    >> > connect to the Foxpro directory by using the ODBC DSN that we
    >> > currently use in ColdFusion, I get the following message:

    >>
    >> > ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    >> > does not exist.

    >>
    >> > I know this is probably a permissions issue because asp.net is being
    >> > run under a local username. I don't want to have to setup the aspnet
    >> > username on the remote server and manually manage passwords, and I
    >> > don't want to set up all web users names on the remote server.
    >> > I already have a specific user 'webuser' that has access rights to
    >> > both the webserver and the foxpro remote directory and would like to
    >> > make use of this existing user to connect from .NET.

    >>
    >> > Is there a way to connect to this FoxPro directory by specifying a
    >> > username password with the connection string?

    >
     
    Juan T. Llibre, Jan 4, 2008
    #6
  7. z71mdridin

    z71mdridin Guest

    I understand that this is a permissions issue. I am just trying to
    figure out how to solve the problem. As mentioned before, I dont want
    to create the ASPNET account on the remote server and manually manage
    the passwords for the account. I already have an account, "webuser",
    setup on both servers that I would like to reuse for this particular
    instance. I am just trying to figure out how to accomplish this. Is
    is possible to include some keyword in the connection string to
    force .net to connect to the foxpro directory as webuser instead of
    aspnet? Is impersonation possible even though I am using forms
    authentication throughout the rest of the site?

    Thanks for all the feedback so far
    On Jan 4, 9:56 am, "Juan T. Llibre" <> wrote:
    > re:
    > !> My connection string is as follows:
    > ...snip...
    > !> but I still get the error message:
    > !> System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    > !> FoxPro Driver]File 'table.dbf' does not exist
    >
    > That's a permissions problem.
    >
    > You are accessing "table.dbf" at a remote server, but the account ASP.NET
    > uses to access the file doesn't have access permissions to "table.dbf".
    >
    > You need to have ASP.NET impersonate a network account which
    > has the necessary permissions to access the "table.dbf" resource.
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq :http://asp.net.do/faq/
    > foros de asp.net, en español :http://asp.net.do/foros/
    > ======================================"z71mdridin" <> wrote in message
    >
    > news:...
    >
    > > Yeah, I have already tried looking there. My connection string is as
    > > follows:
    > > Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\
    > > \remoteServer\foxPro\Data;Exclusive=No;
    > > Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;

    >
    > > but I still get the error message:
    > > System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    > > FoxPro Driver]File 'table.dbf' does not exist.

    >
    > > On Jan 3, 2:27 pm, "Mike" <> wrote:
    > >> this may help

    >
    > >>http://connectionstrings.com/

    >
    > >>http://connectionstrings.com/?carrier=visualfoxpro

    >
    > >> "z71mdridin" <> wrote in message

    >
    > >>news:...

    >
    > >> >I have an asp.net website that uses Form authentication to
    > >> > authenticate users. I need to provide users with a report based on
    > >> > FoxPro data that resides on a remote server. When I attempt to
    > >> > connect to the Foxpro directory by using the ODBC DSN that we
    > >> > currently use in ColdFusion, I get the following message:

    >
    > >> > ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    > >> > does not exist.

    >
    > >> > I know this is probably a permissions issue because asp.net is being
    > >> > run under a local username. I don't want to have to setup the aspnet
    > >> > username on the remote server and manually manage passwords, and I
    > >> > don't want to set up all web users names on the remote server.
    > >> > I already have a specific user 'webuser' that has access rights to
    > >> > both the webserver and the foxpro remote directory and would like to
    > >> > make use of this existing user to connect from .NET.

    >
    > >> > Is there a way to connect to this FoxPro directory by specifying a
    > >> > username password with the connection string?
     
    z71mdridin, Jan 4, 2008
    #7
  8. re:
    !> I dont want to create the ASPNET account on the remote server
    !> and manually manage the passwords for the account.

    What works best is using a network account which ASP.NET
    impersonates when accessing the remote resource.

    The reason you need a network account is that the account needs
    to have access to both the remote compuiter and your IIS server box.

    Only a network account will be able to do that.

    re:
    !> I already have an account, "webuser", setup on both servers
    !> that I would like to reuse for this particular instance.

    Only if it's a network account and you setup ASP.NET to impersonate it.

    The problem is that on Server1 that account will be "Server1\webuser"
    and on Server2 that account will be "Server2\webuser".

    They aren't the same account.

    re:
    !> Is impersonation possible even though I am using
    !> forms authentication throughout the rest of the site?

    Yes.

    Forms authentication and ASP.NET process impersonation are two different things.

    ASP.NET will need to impersonate an identity which has read/change permissions on "table.dbf".
    Your application's users will be able to access "table.dbf" through the impersonated ASP.NET account.

    References...

    "Configuring ASP.NET Process Identity" :
    http://msdn2.microsoft.com/en-us/library/dwc1xthy.aspx

    Make sure you grant access to the impersonated account on your IIS server per this list :
    http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "z71mdridin" <> wrote in message
    news:...
    I understand that this is a permissions issue. I am just trying to
    figure out how to solve the problem. As mentioned before, I dont want
    to create the ASPNET account on the remote server and manually manage
    the passwords for the account. I already have an account, "webuser",
    setup on both servers that I would like to reuse for this particular
    instance. I am just trying to figure out how to accomplish this. Is
    is possible to include some keyword in the connection string to
    force .net to connect to the foxpro directory as webuser instead of
    aspnet? Is impersonation possible even though I am using forms
    authentication throughout the rest of the site?

    Thanks for all the feedback so far
    On Jan 4, 9:56 am, "Juan T. Llibre" <> wrote:
    > re:
    > !> My connection string is as follows:
    > ...snip...
    > !> but I still get the error message:
    > !> System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    > !> FoxPro Driver]File 'table.dbf' does not exist
    >
    > That's a permissions problem.
    >
    > You are accessing "table.dbf" at a remote server, but the account ASP.NET
    > uses to access the file doesn't have access permissions to "table.dbf".
    >
    > You need to have ASP.NET impersonate a network account which
    > has the necessary permissions to access the "table.dbf" resource.
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq :http://asp.net.do/faq/
    > foros de asp.net, en español :http://asp.net.do/foros/
    > ======================================"z71mdridin" <> wrote in message
    >
    > news:...
    >
    > > Yeah, I have already tried looking there. My connection string is as
    > > follows:
    > > Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\
    > > \remoteServer\foxPro\Data;Exclusive=No;
    > > Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;

    >
    > > but I still get the error message:
    > > System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    > > FoxPro Driver]File 'table.dbf' does not exist.

    >
    > > On Jan 3, 2:27 pm, "Mike" <> wrote:
    > >> this may help

    >
    > >>http://connectionstrings.com/

    >
    > >>http://connectionstrings.com/?carrier=visualfoxpro

    >
    > >> "z71mdridin" <> wrote in message

    >
    > >>news:...

    >
    > >> >I have an asp.net website that uses Form authentication to
    > >> > authenticate users. I need to provide users with a report based on
    > >> > FoxPro data that resides on a remote server. When I attempt to
    > >> > connect to the Foxpro directory by using the ODBC DSN that we
    > >> > currently use in ColdFusion, I get the following message:

    >
    > >> > ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    > >> > does not exist.

    >
    > >> > I know this is probably a permissions issue because asp.net is being
    > >> > run under a local username. I don't want to have to setup the aspnet
    > >> > username on the remote server and manually manage passwords, and I
    > >> > don't want to set up all web users names on the remote server.
    > >> > I already have a specific user 'webuser' that has access rights to
    > >> > both the webserver and the foxpro remote directory and would like to
    > >> > make use of this existing user to connect from .NET.

    >
    > >> > Is there a way to connect to this FoxPro directory by specifying a
    > >> > username password with the connection string?
     
    Juan T. Llibre, Jan 4, 2008
    #8
  9. One more thing...

    Fellow MVP Rick Strahl has written "Web Connection" :

    http://www.west-wind.com/webconnection/

    It allows you to connect Web Applications to Visual FoxPro with minimum fuss/problems.

    If you are committed to Visual FoxPro as a database platform,
    you can't do any better than what Rick has written for "Web Connection".

    You get full FoxPro source code to learn from/modify as you like.



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "z71mdridin" <> wrote in message
    news:...
    I understand that this is a permissions issue. I am just trying to
    figure out how to solve the problem. As mentioned before, I dont want
    to create the ASPNET account on the remote server and manually manage
    the passwords for the account. I already have an account, "webuser",
    setup on both servers that I would like to reuse for this particular
    instance. I am just trying to figure out how to accomplish this. Is
    is possible to include some keyword in the connection string to
    force .net to connect to the foxpro directory as webuser instead of
    aspnet? Is impersonation possible even though I am using forms
    authentication throughout the rest of the site?

    Thanks for all the feedback so far
    On Jan 4, 9:56 am, "Juan T. Llibre" <> wrote:
    > re:
    > !> My connection string is as follows:
    > ...snip...
    > !> but I still get the error message:
    > !> System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    > !> FoxPro Driver]File 'table.dbf' does not exist
    >
    > That's a permissions problem.
    >
    > You are accessing "table.dbf" at a remote server, but the account ASP.NET
    > uses to access the file doesn't have access permissions to "table.dbf".
    >
    > You need to have ASP.NET impersonate a network account which
    > has the necessary permissions to access the "table.dbf" resource.
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq :http://asp.net.do/faq/
    > foros de asp.net, en español :http://asp.net.do/foros/
    > ======================================"z71mdridin" <> wrote in message
    >
    > news:...
    >
    > > Yeah, I have already tried looking there. My connection string is as
    > > follows:
    > > Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\
    > > \remoteServer\foxPro\Data;Exclusive=No;
    > > Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;

    >
    > > but I still get the error message:
    > > System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Visual
    > > FoxPro Driver]File 'table.dbf' does not exist.

    >
    > > On Jan 3, 2:27 pm, "Mike" <> wrote:
    > >> this may help

    >
    > >>http://connectionstrings.com/

    >
    > >>http://connectionstrings.com/?carrier=visualfoxpro

    >
    > >> "z71mdridin" <> wrote in message

    >
    > >>news:...

    >
    > >> >I have an asp.net website that uses Form authentication to
    > >> > authenticate users. I need to provide users with a report based on
    > >> > FoxPro data that resides on a remote server. When I attempt to
    > >> > connect to the Foxpro directory by using the ODBC DSN that we
    > >> > currently use in ColdFusion, I get the following message:

    >
    > >> > ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'table.dbf'
    > >> > does not exist.

    >
    > >> > I know this is probably a permissions issue because asp.net is being
    > >> > run under a local username. I don't want to have to setup the aspnet
    > >> > username on the remote server and manually manage passwords, and I
    > >> > don't want to set up all web users names on the remote server.
    > >> > I already have a specific user 'webuser' that has access rights to
    > >> > both the webserver and the foxpro remote directory and would like to
    > >> > make use of this existing user to connect from .NET.

    >
    > >> > Is there a way to connect to this FoxPro directory by specifying a
    > >> > username password with the connection string?
     
    Juan T. Llibre, Jan 4, 2008
    #9
    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. Jan Smazinka

    Visual FoxPro OleDB Driver in ASP.NET

    Jan Smazinka, Nov 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,043
    Jan Smazinka
    Nov 28, 2003
  2. Amedee Van Gasse
    Replies:
    2
    Views:
    2,864
    Buddy Ackerman
    Jun 16, 2005
  3. thomson

    Foxpro window Migration .net

    thomson, Oct 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    470
    thomson
    Oct 19, 2005
  4. Burak Gunay

    Help with connecting to FoxPro please

    Burak Gunay, Feb 7, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    467
  5. ninel

    .NET & Foxpro OLEDB

    ninel, Mar 6, 2008, in forum: .NET
    Replies:
    0
    Views:
    864
    ninel
    Mar 6, 2008
Loading...

Share This Page