Home | Index | Dotnet4all Snippets | Submit resources
About | Mail us 
SQLDMO error in .NET (Thursday, January 26, 2006)

 

Found the following interesting discussion in the Newsgroups:

SQLDMO error in .NET
by:Anonymous

I've been trying to use SQLDMO in a web app using VB .NET 2002. SQLDMO is registered on my system and I can use the CreateObject("SQLDMO.SQLServer") in both VBScript and Excel VBA code. Also SQL Enterprise Manager works fine. SQLServer SP3a has also been applied on my system.

I created the reference to SQLDMO in my project and the Interopt.SQLDMO.dll is created. I can view the structure of the Interopt.SQLDMO assembly in the VS Object Browser. Here is the code in the ASPX.VB component:

Imports SQLDMO

Public Class WebForm1
Inherits System.Web.UI.Page
Protected oSvr As SQLDMO.SQLServer

#Region " Web Form Designer Generated Code "

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
oSvr = New SQLDMO.SQLServer()
End Sub

End Class

When I run the code I get this error when the code hits the oSvr = New SQLDMO.SQLServer() line:

COM object with CLSID {10020200-E260-11CF-AE68-00AA004A34D5} is either not valid or not registered.

The GUID points to the CLSID for SQLDMO in the registry. I'm also at the base release for .NET Framework 1.0. Yes, I tried SP2 for .NET 1.0.

Is there anything else I can try?

Thanks,
Pete


 Reply:
by:Anonymous

 Pete,

Does the "Launch IIS Process Account" have permission to read the registry keys required by SQLDMO? It won't by default. Try giving it full read access to the root of HKEY_CLASSES_ROOT then test again.

If it works then it is a security issue with the registry and you will need to delve a bit deeper and workout what keys it needs permission to but it will point you in the right direction.

Chris.


 Reply:
by:Anonymous

 Chris,
No good on the permissions. I added that user to the local Administrators group on the system and the errorstill came up. I have another preson in my group that this works fine for. His system had no groups set for the IIS account.



 Reply:
by:Ken Tucker [MVP]

 Hi,

I am not getting that error with vs.net 2003 using ver 1.1 of the
framework. There is a tech preview of service pack 3 for framework ver 1.0
available. (Use at own risk.)

http://www.microsoft.com/downloads/details.aspx?FamilyId=CF52CA95-F2CC-459F-87EE-C17D16E22F08&displaylang=en
Ken


 Reply:
by:Anonymous

 Here's an update. It works now!!!

I tested the Interop interface with the SQLXML COM object and it worked fine. At least this showed that .NET install was good.

I then did a full removal of MSDE and the SQL Server client software. After the uninstall, I went throuhg the registry and removed every last vestage of SQLDMO I found. It looked like many of the registry entries were still left there even after the uninstall. I also deleted all the SQL Server directories under the "Program Files" directory.

I ran the install of the SQL Server client software and applied SP3a to it. After that, NO ERRORS!!!

So0mething was hosed on my system when it came to SQLDMO. The full wipe and install put it right.

Practice Safe Hex,
Pete



Posted by Xander Zelders



0 Comments:

Post a Comment

<< Home

 
Previous Posts
    - Can't write to the event log
    - Communication
    - Crystal report
    - api call using struct*
    - Custom message loop
    - Newline in a datatable column
    - Embed dll
    - How to show icons in a checked list box?
    - Grabber control ?
    - Datagrid with grouping



Disclaimer & Terms of Use | DotNet4All.Com concept & © 2004 - 2007 by Zelders² - Holland