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
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
Comment