Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

SQL Server Query .dbf file

Avatar of Ursino
Ursino asked on
Microsoft SQL ServerMicrosoft DevelopmentMicrosoft SQL Server 2008
11 Comments1 Solution5102 ViewsLast Modified:
What:
Trying to query a .dbf file e.g "Select * from somefile.dbf"

Using:
SQL Server 2008

Problem:
I can't figure out what I need to do to accomplish this.

Tried:
Various forms of linkedserver,  but I can't anything to work.
I even installed vfpoledb on the server.

ALSO

            
            select * from openrowset('MSDASQL',
            'DSN=Visual FoxPro Tables;                              
            SourceDB= \\MYSERVER\FOLDER\;
            SourceType=DBF',
            'select * from dbfTable') 

gives error:

OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".

Msg 7303, Level 16, State 1, Line 7
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)"


Request:
Can someone help me with some straight script to connect to this .dbf file?

Something similar to if say I was going to connect to .xls file:
(this is from another solution)

     EXEC sp_addlinkedserver MyExcel,
     'Jet 4.0',
     'Microsoft.Jet.OLEDB.4.0',
     'c:\ee\test1_work.xls', 
      NULL,
     'Excel 5.0;'
 
GO 
--Set up login mappings (just ADMIN - jet wants something).
EXEC sp_addlinkedsrvlogin MyExcel, FALSE, NULL, Admin, NULL
GO
--List the tables in the linked server (these are the worksheet names).
EXEC sp_tables_ex MyExcel
GO
select * from myexcel...Sheet1$
GO



Thank you!
ASKER CERTIFIED SOLUTION
Avatar of Ursino
Ursino

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answers