Home All Groups Group Topic Archive Search About
Author
24 Aug 2006 1:09 PM
Brad Baker
We have an in house VB app that we use for managing our databases (creating
databases, adding databases to maintenance plans, transfering data etc). The
app relies primarily on SQL-DMO which is fine as up until this point we have
only had SQL2000 servers.

However we are preparing to launch some new SQL2005 servers and the tool no
longer seems to work. We get the following error:

Description: [Microsoft][ODBC SQL Server Driver][SQL Server]To connect to
this server you must use SQL Server Management Studio or SQL Server
Management Objects (SMO).

The developer of this app said that he had read online that SQL-DMO could be
used with SQL2005 if the Backward Compatibility Components had been
installed. I verified the components are installed but we are still getting
an error. Does something have to be done to enable SQL-DMO to work after the
backward compatibility components are loaded? Or are we wasting our time and
the app needs to be re-written to use SMO instead of DMO?

Thanks,
Brad

Author
25 Aug 2006 6:03 AM
Charles Wang[MSFT]
Hi Brad,
From your description, I understand that:
Your VB application was not able to work due to migration from SQL Server
2000 to SQL Server 2005. The error message showed that SQL-DMO component
should be replaced by SMO assembly.
If I have misunderstood, please let me know.

From my research, you can use SQL-DMO COM reference to access and manage
SQL Server 2005. I recommend that you debug your application to locate the
error place. Also, I would like that you could check whether or not DTS is
managed by SQL-DMO component in your VB application. This feature is not
supported in SQL Server 2005 and has been replaced by SSIS. If you want to
manage SQL Server 2005 instances and take advantage of its new features, I
recommend SMO for your first choice.

My simple test environment is C#.NET, SQLDMO.DLL (SQL Server 2000).
In my simple test, I managed to create a database on a remote SQL Server
2005 instance. Here is my code slice:
SQLDMO.SQLServer oserver = new SQLDMO.SQLServerClass();
            oserver.Connect("<serverinstancename>", "sa", "sa");
            SQLDMO.Database db = new SQLDMO.DatabaseClass();
            db.Name = "DMODBTest";
            oserver.Databases.Add(db);
            MessageBox.Show("OK");
I also managed to remove a table from a database with compatible level 90
(SQL Server 2005):
            SQLDMO.SQLServer oserver = new SQLDMO.SQLServerClass();
            oserver.Connect("<serverinstancename>", "sa", "sa");
            SQLDMO.Database db =
(SQLDMO.Database)oserver.Databases.Item("FRT", "dbo");
            db.Tables.Remove("TNT", "dbo");
            MessageBox.Show("OK");

You can try using the stored procedure sp_dbcmptlevel to change a database
compatibility level into 80, however it may not have help on this issue.

If the issue persists, you can also try re-registering the sqldmo component
or reinstalling the workstation components for test.

For more information, you can refer to the content of SQL-DMO and SMO in
SQL Server 2005 Books Online.

If you have any other questions or concerns, please feel free to let me
know. It's my pleasure to be of assistance.

Charles Wang
Microsoft Online Community Support

======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
Author
29 Aug 2006 1:08 PM
Brad Baker
It turns out that our problem was we loaded the Backward Compatibility
Components on the SQL 2005 server but not on the SQL 2000 server. Once the
components were loaded on both servers everything seems to work fine.

Thanks,
Brad


Show quote
"Charles Wang[MSFT]" <chang***@online.microsoft.com> wrote in message
news:GUGmxwAyGHA.3392@TK2MSFTNGXA01.phx.gbl...
> Hi Brad,
> From your description, I understand that:
> Your VB application was not able to work due to migration from SQL Server
> 2000 to SQL Server 2005. The error message showed that SQL-DMO component
> should be replaced by SMO assembly.
> If I have misunderstood, please let me know.
>
> From my research, you can use SQL-DMO COM reference to access and manage
> SQL Server 2005. I recommend that you debug your application to locate the
> error place. Also, I would like that you could check whether or not DTS is
> managed by SQL-DMO component in your VB application. This feature is not
> supported in SQL Server 2005 and has been replaced by SSIS. If you want to
> manage SQL Server 2005 instances and take advantage of its new features, I
> recommend SMO for your first choice.
>
> My simple test environment is C#.NET, SQLDMO.DLL (SQL Server 2000).
> In my simple test, I managed to create a database on a remote SQL Server
> 2005 instance. Here is my code slice:
> SQLDMO.SQLServer oserver = new SQLDMO.SQLServerClass();
>            oserver.Connect("<serverinstancename>", "sa", "sa");
>            SQLDMO.Database db = new SQLDMO.DatabaseClass();
>            db.Name = "DMODBTest";
>            oserver.Databases.Add(db);
>            MessageBox.Show("OK");
> I also managed to remove a table from a database with compatible level 90
> (SQL Server 2005):
>            SQLDMO.SQLServer oserver = new SQLDMO.SQLServerClass();
>            oserver.Connect("<serverinstancename>", "sa", "sa");
>            SQLDMO.Database db =
> (SQLDMO.Database)oserver.Databases.Item("FRT", "dbo");
>            db.Tables.Remove("TNT", "dbo");
>            MessageBox.Show("OK");
>
> You can try using the stored procedure sp_dbcmptlevel to change a database
> compatibility level into 80, however it may not have help on this issue.
>
> If the issue persists, you can also try re-registering the sqldmo
> component
> or reinstalling the workstation components for test.
>
> For more information, you can refer to the content of SQL-DMO and SMO in
> SQL Server 2005 Books Online.
>
> If you have any other questions or concerns, please feel free to let me
> know. It's my pleasure to be of assistance.
>
> Charles Wang
> Microsoft Online Community Support
>
> ======================================================
> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ======================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> ======================================================
>
Author
29 Aug 2006 4:15 PM
Charles Wang[MSFT]
Hi Brad,
I'm glad to hear that your issue has been fixed.
If you have any other questions or concerns, please feel free to let me
know. It's my pleasure to be of assistance.

Have a great day!

Charles Wang
Microsoft Online Community Support

AddThis Social Bookmark Button