question

Fatherjack avatar image
Fatherjack asked

TSQL to query Exchange Server data

Can anyone tell me whether it is possible to successfully connect to an Exchange 2003 email server from a SQL Server 2005 server and interrogate the folders with TSQL please? BOL has a very brief and not too clear section that an Exchange server can be added as a linked server but doesnt give enough detail for me to make a successfull connection between our servers.

Exchange and SQL are on different hardware which I understand is not a show stopper so, for sake of this example we have: SQLSvr and ExchSvr on the MyDom.net domain.

I have executed several variations of:

EXEC sp_addlinkedserver 'TestExchange',
'Exchange OLE DB provider', 
'c:\program files\exoledb',
'file:\\.\backofficestorage\MailSrv.MyDom.net\public folders'

and after running a query or try to use Object Explorer to view the object get the same error of

Msg 7403, Level 16, State 1, Procedure Contacts, Line 4 The OLE DB provider "c:\program files\exoledb.DataSource.1" has not been registered.

I have copied the exoledb.dll from ExchSvr and registering it on SQLSvr but the error still occurs.

Can anyone advise me what other steps need to be taken please?

sql-server-2008sql-server-2005exchange
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image Kev Riley ♦♦ commented ·
out of interest did the registering of exoledb.dll go succesfully. If so, how did you do it?
0 Likes 0 ·
Fatherjack avatar image Fatherjack ♦♦ commented ·
update 20091207- using c:\\program files\\common files\\system\\ole db\\regsvr32 exoledb.dll to register the dll returns an error: LoadLibrary("exoledb.dll"") failed - The specified module could not be found.I think that this means there are dependencies in the dll but I cant find details on any other than those mentioned here : http://support.microsoft.com/kb/296436/ and both dlls mentioned in this article are already registered successfully.
0 Likes 0 ·
Fatherjack avatar image Fatherjack ♦♦ commented ·
later ... above I say that "boths dlls" are registered. The article also mentions msdaipp.dl. I cant find that on any of our servers in order to register it but it seems to be related to SharePoint so I am not sure thats necessary
0 Likes 0 ·
sp_lock avatar image
sp_lock answered

If you run the script below you it will show you all the available oledb providers installed on your SQL Server

use master
go
exec xp_enum_oledb_providers
go
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fatherjack avatar image Fatherjack ♦♦ commented ·
Yeah, this and the SSMS view agree with the error - the exoledb dll simply isnt registered but I dont know why... or how to get it to register successfully
0 Likes 0 ·
sp_lock avatar image sp_lock commented ·
You could try the following.. - Open a command prompt. - run "regsvr32 /s exoledb.dll" (make sure you are in the directory where the dll is installed to). You should get a "Succuess" message
0 Likes 0 ·
Fatherjack avatar image Fatherjack ♦♦ commented ·
running that is where i get the error that I describe
0 Likes 0 ·
Kev Riley avatar image
Kev Riley answered

The only thing that makes me suspicious is that in BOL it only talks about Exchange 2000, and you would think that if this worked in higher versions, then they would be mentioned too......

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.