Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Accessing DBF FoxPro on Network

Reply
Thread Tools

Accessing DBF FoxPro on Network

 
 
=?Utf-8?B?WWFtYQ==?=
Guest
Posts: n/a
 
      01-30-2004
Hi All

I am trying to access a Fox Pro Free Table on the network as follow

Dim cmd As New OdbcCommand
Dim conn As OdbcConnection = New OdbcConnection("Driver={Microsoft Visual FoxPro Driver};" &
"SourceType=DBF;" &
"SourceDB=L:\my_mapped_folder_on_the_network_where _DBF_file_exists\;" &
"Exclusive=No"
If conn.State = ConnectionState.Closed Then conn.Open(
cmd.CommandText = "select * from freetable
cmd.CommandType = CommandType.Tex
cmd.CommandTimeout = 120 '-- 2 minutes
cmd.Connection = con
conn.Open(
Dim ds As DataSet = New DataSe
Dim da As New OdbcDataAdapter(cmd
Tr
'--- Fill the DataSe
da.Fill(ds
Catch ex As Exceptio
' Close the connection when done with it
If conn.State = ConnectionState.Open Then conn.Close(
ErrorMessage = ex.Message 'In web.config Redirect to Error message pag
Throw New Exceptio
Finall
cmd.Dispose(
da.Dispose(
' Close the connection when done with it
If conn.State = ConnectionState.Open Then conn.Close(
End Tr

However I get this error message
ERROR [42S02] [Microsoft][ODBC Visual FoxPro Driver]File 'cashblk.dbf' does not exist

If I copy the 'cashblk.dbf' and the 'cashblk.fpt' on one of local drives as
Dim conn As OdbcConnection = New OdbcConnection("Driver={Microsoft Visual FoxPro Driver};" &
"SourceType=DBF;" &
"SourceDB=C:\my_drive_where_I_copied_the_free_tabl e;" &
"Exclusive=No"

In works! BUT I really would like to know why it won't work if I use the network as well as why do I get the error message and finally how I can resolve it or work around it

I will truly appreciate input on this topic

Sincerely

Yama Kamyar
Sr. Microsoft .NET Consultant
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.net 2.0 .. Stuck with DBF file access from Network Drive kaushalparik Software 1 04-26-2007 09:36 AM
Drag n drop FoxPro table to create XSD file - error message alex9128 ASP .Net 1 09-08-2005 03:39 PM
Reading dbf file over network possible? Vijoy Varghese Perl Misc 1 11-24-2003 11:09 PM
calling stored procedure from Visual FoxPro database JN ASP .Net 0 11-05-2003 03:00 PM
foxpro 5.0 jeff Microsoft Certification 0 09-02-2003 01:50 AM



Advertisments