Foxpro database connectivity Urgent Help please

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • smtwtfs007@gmail.com

    #1

    Foxpro database connectivity Urgent Help please

    I have an ASP.NET website.
    I'm trying to connect to a Foxpro database (ADO.NET) with the
    following
    connect string:

    txtConnectionSt r.Text = "\\soya4042\Qd\ LM\LMS\Data"
    Dim strFoxProDirect ory As String = txtConnectionSt r.Text
    Dim strConnection As String = "User ID=;DSN=;Cache
    Authentication= False;Data Source='" & _
    Trim(strFoxProD irectory) & "'" & _
    ";Provider='VFP OLEDB.1';Collat ing
    Sequence=Machin e;Mask " & _
    "Password=False ;persist security info=False;"
    & _
    "Mode=Share Deny None;Extended
    Properties=;Enc rypt Password=False"

    If I put the same string in a VB.NET the connection string works fine.
    Do you have any other suggestions?

    I can open the network path and read the files in my windows explorer
    \
    \soya4042\Qd\LM \LMS\Data

    Invalid path or file name.
    Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code.

    Exception Details: System.Data.Ole Db.OleDbExcepti on: Invalid path or
    file name.

    Source Error:

    Line 44: ODBCCon.Connect ionString = strConnection
    Line 45: m_OleDBConnecti on = ODBCCon
    Line 46: m_OleDBConnecti on.Open()
    Line 47:
    Line 48: Dim strSelect As String = "Select dsid, dsname,
    FName from dsmaster order by dsname"

    Source File: c:\inetpub\wwwr oot\WebApplicat ion1\WebForm1.a spx.vb
    Line: 46

    Stack Trace:

    [OleDbException (0x80040e21): Invalid path or file name.]
    System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
    System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
    System.Data.Ole Db.OleDbConnect ion.Open() +203
    WebApplication1 .WebForm1.btnCo nnect_Click(Obj ect sender, EventArgs
    e) in c:\inetpub\wwwr oot\WebApplicat ion1\WebForm1.a spx.vb:46
    System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

    System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
    eventArgument) +57
    System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
    sourceControl, String eventArgument) +18
    System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
    +33
    System.Web.UI.P age.ProcessRequ estMain() +1292

  • Cindy Winegarden

    #2
    Re: Foxpro database connectivity Urgent Help please



    <smtwtfs007@gma il.comwrote in message
    news:1182362395 .888238.104610@ n2g2000hse.goog legroups.com...
    >I have an ASP.NET website.
    I'm trying to connect to a Foxpro database (ADO.NET) with the
    following
    connect string:
    >
    txtConnectionSt r.Text = "\\soya4042\Qd\ LM\LMS\Data"
    If I put the same string in a VB.NET the connection string works fine.
    Do you have any other suggestions?
    >
    I can open the network path and read the files in my windows explorer
    \
    \soya4042\Qd\LM \LMS\Data
    Hi !

    The web server account must have permissions to the directory where the DBFs
    are stored. Can you try your code against data on the local machine?

    By the way, since VFP doesn't have password security, etc. you don't need
    all the extra stuff in the connection string. All you need is something like
    "Provider=VFPOL EDB.1;Data Source=C:\MyFol der\Test\;"

    --
    Cindy Winegarden
    cindy@cindywine garden.com

    VFP OLE DB: http://msdn2.microsoft.com/en-us/vfoxpro/bb190232.aspx
    VFP ODBC: http://msdn2.microsoft.com/en-us/vfoxpro/bb190233.aspx




    Comment

    Working...