Considerations for C # after referencing Interop.SQLDMO.dll (go)

Source: Internet
Author: User

C # methods for referencing Sqldmo.dll
Find Sqldmo.dll This file
C:\Program Files\Microsoft SQL Server\80\tools\binn\sqldmo.dll
Use the tools provided with the. NET Framework to turn to managed code
TlbImp Sqldmo.dll/out:c:\sqldmo.dll

Title, is there any way?
If you must use SQLDMO, then how to use this COM component on a machine that does not have SQL installed.
I always get an error on a machine that doesn't have SQL installed.
Publish the following files to the System32 directory
Sqldmo.dll
Sqlunirl.dll
Sqlresld.dll
Sqlsvc.dll
W95scm.dll
Resources\2052\sqldmo.rll
Resources\2052\sqlsvc.rll

Then run regsvr32 sqldmo.dll




In previous versions of SQL Server2005, SQL Distributed Management Objects (SQL-DMO) provided a very effective way for us to programmatically manage SQL Server. SQL-DMO supports COM-based interfaces that developers can use to discover and manipulate SQL Server objects. SQL Server2005 has made a much greater improvement in this area by providing a new management framework called SQL Server Management Objects (SMO), which has more powerful management capabilities and is built on. Net Framework2.0. Of course, we can still use SQL-DMO to manage SQL Server2005, but SMO gives us more functionality and supports many of the new features of SQL Server2005, and its performance is more optimized than SQL-DMO.
Microsoft defines SMO as "an object designed for the programmable management of Microsoft SQL Server." SMO gives developers the ability to more comprehensively manage the various elements of SQL Server, such as tables, columns, indexes, stored procedures, triggers, Service brokers, snapshot databases, backups and restores, files and filegroups, and so on.
C:\Program Files\Microsoft SQL Server\90\sdk\assemblies\microsoft.sqlserver.smo.dll

SQLDMO.dll is a good thing, and ASP. NET uses it to realize the functions of online backup, restore database and so on. Recently, customers have asked for their ability to add a management database in the background. So there was this article.
Since the client's database and Web service are no longer the same server, when we deploy the site on the server, run the program, prompting the following error:

retrieving the COM class factory for component and CLSID {10020200-E260-11CF-AE68-00AA004A34D5} failed due to the fol lowing error:80040154.

And customers don't want to install MSSQL on this computer, so we just need to register the SQLDMO.DLL component on a computer that does not have MSSQL installed.
First step: First will MSVCR71.dll, SQLDMO. DLL, Resources\2052\sqldmo.rll,resources\1033\sqldmo.rll Copy to C:\Program Files\Microsoft SQL Server\80\Tools\Binn directory.
Download SQLDMO File
Step two: Open start, enter regsvr32 "C:\Program Files\Microsoft SQL Server\80\tools\binn\sqldmo.dll" in the Run to register Sqldmo.dll.

Under normal circumstances, after the above two steps, the Web page should be accessible. However, after the above two operations, access to the webpage still prompts the following error:

retrieving the COM class factory for component and CLSID {10020200-E260-11CF-AE68-00AA004A34D5} failed due to the fol lowing error:80070005.

after a period of checking , we found that the C:\Program files\ folder has only control permissions for administrator and system, and no other user permissions, so we add the network Service to the Microsoft SQL Server folder The Read permission.
At this point, the problem has been solved!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.