FoxPro database connectivity



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

txtConnectionStr.Text = "\\soya4042\Qd\LM\LMS\Data"
Dim strFoxProDirectory As String = txtConnectionStr.Text
Dim strConnection As String = "User ID=;DSN=;Cache
Authentication=False;Data Source='" & _
Trim(strFoxProDirectory) & "'" & _
Sequence=Machine;Mask " & _
"Password=False;persist security info=False;"
& _
"Mode=Share Deny None;Extended
Properties=;Encrypt 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 \

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.OleDb.OleDbException: Invalid path or
file name.

Source Error:

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

Source File: c:\inetpub\wwwroot\WebApplication1\WebForm1.aspx.vb
Line: 46

Stack Trace:

[OleDbException (0x80040e21): Invalid path or file name.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
WebApplication1.WebForm1.btnConnect_Click(Object sender, EventArgs
e) in c:\inetpub\wwwroot\WebApplication1\WebForm1.aspx.vb:46
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

eventArgument) +57
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1292


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question