Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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

  • Administrator
  • 25,202 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