Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing foxpro from asp.NET
Message
From
17/02/2004 14:43:55
 
 
To
16/02/2004 13:59:08
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00877719
Message ID:
00878060
Views:
13
Hi, Shevy-

>I am having a very hard time accessing a foxpro database from my asp.net web page.
>here is my code:
>
>         Dim connectionString = "DSN=VFPD;Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=\\name_of_server_with_dta;Exclusive=No"
>        Dim connection As New OdbcConnection(connectionString)
>        Dim strSql = "select * from title where upper(titlenum)=testtitlenum"
>        Dim adapter As New OdbcDataAdapter
>        adapter.SelectCommand = New OdbcCommand(strSql, connection)
>        Dim result As New DataSet
>        adapter.Fill(result)
>
>It is breaking out on the line adapter.Fill(result) with the following error:
>ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'title.dbf' does not exist.
>when i move my table to my local C: drive it works fine..
>what am i doing wrong??

May I ask ifyou are using the VFP 8.0 OLEDB provider? If not, you might consider doing so. (http://www.microsoft.com/downloads/details.aspx?familyid=0f43eb58-7a94-4ae1-a59e-965869cb3bc9&displaylang=en)

Is the \\name_of_server_with_dta a UNC? Any chance it's a mapped drive? ASP.NET doesn't like mapped drives, at least with the default security settings. (I haven't investigated how to change this.)

BTW, here's an example of a connection string using the OLEDB provider:
this.m_ConnString = String.Format("Provider=VFPOLEDB;Data Source={0}WebRegister.DBC;" +
				"Mode=Share Deny None;" +
				"Extended Properties=\"\";" +
				"User ID=\"\";Password=\"\";" + 
				"Mask Password=False;Cache " +
				"Authentication=False;" + 
				"Encrypt Password=False;" + 
				"Collating Sequence=MACHINE",this.m_Configuration["DataPath"]);
Previous
Reply
Map
View

Click here to load this message in the networking platform