Help with connecting to FoxPro please

B

Burak Gunay

Hello,

I am trying to connect to a visual fox pro table from my asp.net page.

I dragged an odbc connection and set it to a visual fox pro driver file
dsn pointing to "mydocuments" folder.

Here is the connection string

SourceDB=c:\Documents and Settings\bgunay\My
Documents;PWD=;SourceType=DBF;Collate=Machine;Deleted=Yes;BackgroundFetch=Yes;Exclusive=No;Driver=Microsoft
Visual FoxPro Driver;Null=Yes;UID=

I then dragged an odbc command and set it to this connection. I was
then able to see the list of visual fox pro(.dbf) tables in "my
documents" folder. I then set the query to command text to return every
record from the "corp" table.

Then, I executed the command as follows

cnn.Open()

Dim reader As Odbc.OdbcDataReader
reader = OdbcCommand.ExecuteReader()
While reader.Read
Response.Write(reader.Item(0) & "<br>")
End While

It came back with "Corp.dbf does not exist" which is so bizarre since
corp.dbf exists
and is visible when I build the odbc command. But for some reason when
I try to select records from it from the code behind, I get that weird
message.

Any ideas?

Thanks,

Burak
 
B

Burak Gunay

Hi Ray,

I used the oledb connection string

"Provider=vfpoledb.1;Data Source=C:\MyDataDirectory\;Collating
Sequence=general"

It said I need to register 'vfpoledb.1' on my machine.

How do you make sure ASP.NET accoutn has access to DBF files?

Thanks,

Burak
 
R

ray.bradbury9

It said I need to register 'vfpoledb.1' on my machine.

Try downloading it (don't remember the page, perhaps MS?) and install.
How do you make sure ASP.NET accoutn has access to DBF files?

ASP.NET runs under a certain account depending on the OS used. In XP
the user is ASPNET. Make sure it has read (or read/write) access to the
folder the DBF's are in.
 

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

Top