sql server 2005 linked server to dbf file

I'm wondering how to setup a linked server for a clipper dbf file.  can someone please post the transact sql to do this??
Fraser_AdminAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris MangusDatabase AdministratorCommented:
Try this:

select * from OPENROWSET('MICROSOFT.JET.OLEDB.4.0','dBase III;HDR=NO;IMEX=2;DATABASE={path to dbf}','select * from {filename}.dbf')
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fraser_AdminAuthor Commented:
how do i add the linked server though?
0
Chris MangusDatabase AdministratorCommented:
I was never able to do this via linked server.  The best I could ever do was to put the data into a holding table and then work with it.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Fraser_AdminAuthor Commented:
so i need to access this table in a sp to select values to select into another table.  will this be possible using your method?
0
Fraser_AdminAuthor Commented:
I tried the 3 ways of calling it.  My table is chipbill.dbf and the path of where it is located is \\serv\apps\chip.  Is there something i'm missing here.  All 3 ways produce the error below...

select * from OPENROWSET('MICROSOFT.JET.OLEDB.4.0','dBase III;HDR=NO;IMEX=2;DATABASE=\\serv\apps\chip\chipbill.dbf','select * from chipbill.dbf')

select * from OPENROWSET('MICROSOFT.JET.OLEDB.4.0','dBase III;HDR=NO;IMEX=2;DATABASE=\\serv\apps\chip','select * from chipbill.dbf')

select * from OPENROWSET('MICROSOFT.JET.OLEDB.4.0','dBase III;HDR=NO;IMEX=2;DATABASE=\\serv\apps\chip\','select * from chipbill.dbf')

OLE DB provider "MICROSOFT.JET.OLEDB.4.0" for linked server "(null)" returned message "'\\serv\apps\chip' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MICROSOFT.JET.OLEDB.4.0" for linked server "(null)".
0
Chris MangusDatabase AdministratorCommented:
You don't have the Jet OLEDB provider on your machine.  You can download it from Microsoft.
0
Fraser_AdminAuthor Commented:
when i go into the setup for linked servers i see the option:
microsoft jet 4.0 oledb provider.

does that mean it would be installed on the machine?
0
Chris MangusDatabase AdministratorCommented:
It should be on the machine then.  I'd try bringing the dbf locally first and see if you can open it.  If so then there is a permissions problem.  If you can't then this provider can't open that dbf and we'll have to find another that can.
0
Fraser_AdminAuthor Commented:
yes that fixed it.  it may not like the fact that it is on another machine.  not a biggie, i can move it.

now how do i actually query it...

select * from mytable where myfield = 'BLAH'

i can't seem to get this to work.
0
Chris MangusDatabase AdministratorCommented:
select * from OPENROWSET('MICROSOFT.JET.OLEDB.4.0','dBase III;HDR=NO;IMEX=2;DATABASE=\\serv\apps\chip\chipbill.dbf','select * from chipbill.dbf')  Where myField = 'BLAH'
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.