Okay, thanks. Do you have a SMO code snippet that accomplishes the above?
Main Topics
Browse All TopicsHi all
I have the below Access code snippet working for SQL 2000 servers, but not SQL 2005. Does anyone have experience with this?
Dim oServer As SQLDMO.SQLServer
Set oServer = New SQLDMO.SQLServer
oServer.LoginSecure = True
'The below line works for 2000 servers, but produces a 'To connect to this server you must use SQL Server Management Studio or SQL Server Management Objects (SMO) errmsg for 2005 servers
oServer.Connect "SomeServerName"
Thanks in advance.
Jim
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I have a working solution.
In Access VBA code I'm able to determine if this is a 2000 vs. 2005 database.
If 2000, I retain the original SQL-DMO code that works fine.
If 2005, I use an ADODB.Connection to connect to that server's master db, then query the sys.databases view to get the list.
Unless I see some SMO code that pulls this off, I'll request a PAQ-Refund in a couple of days.
Business Accounts
Answer for Membership
by: dbaduckPosted on 2008-11-18 at 14:10:21ID: 22989483
Remember that usually SMO is backward compatible, but not forward compatible. The code that you have is friendly to SQL 2000, but not 2005. And in this case, you are using DMO which is replaced by SMO. You need to have the SMO components in order to connect to some of the items in SQL 2005, so you need to get the 2005 SMO components and you should be good. The other thing to remember is that SQL 2005 SMO will almost always work on SQL 2000.