Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

How to open dbf file ?


Best Answer daviddalin , 05 June 2015 - 11:53 AM

A linked server is basically just a pointer that lets the code within your database interact with external data sources as if they were also within your database/instance. There are some examples h... Go to the full post »


  • Please log in to reply

#1
JonahSnow

JonahSnow

    New Member

  • Member
  • Pip
  • 1 posts

I am trying to load DBF files into SQL server within CLR (actually if just running the select statement outside, say within the SQLQuery window, i got the same result), but with the following error:

Msg 7314, Level 16, State 1, Line 1
The OLE DB provider "VFPOLEDB" for linked server "MYDBF" does not contain the table "T8866064". The table either does not exist or the current user does not have permissions on that table.


I created the linked server in this way

EXEC sp_addlinkedserver
@server = 'MYDBF', 
@provider = 'VFPOLEDB', 
@srvproduct = 'My Data',
@datasrc = 'c:\data'

i did not create the login since my SQL instance is running under a superaccount with all privilege.

What frustrates me is that i can read most of the dbf files, but just a few of them is not readable.

Can anyone give me some hints on it?

by the way, i am using vfp9.0

thanks


  • 0

Advertisements


#2
azarl

azarl

    GeekU Admin

  • Community Leader
  • 25,310 posts

You don't need OLEDB to open a dbf in VFP, it's the native file format. Just open it

* Open file
select 0
USE c:\data\filname.dbf alias filename

* Close file
USE filename IN 0

  • 0

#3
daviddalin

daviddalin

    New Member

  • Member
  • Pip
  • 1 posts
✓  Best Answer

A linked server is basically just a pointer that lets the code within your database interact with external data sources as if they were also within your database/instance. There are some examples here for creating linked servers to DBF Viewer Tool:

http://www.dbf.viewertool.com/

So for example if you had a linked server to a FoxPro database called MyFoxProDB you could run a query within SQL Server like this:

UPDATE t
SET t.foo = x.bar
FROM dbo.LocalTable AS t
INNER JOIN MyFoxProDB...TableName AS x
ON t.key = x.key;

You could also consider using OPENROWSET as described in this question:

http://www.filerepai...-corrupted-file


  • 1






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP