By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

Accessing .Net components from SQL Server..

P: n/a
H S
Hi all,
Has anybody tried doing this?? I followed this article to the T, but still
have problems in the last step..
When I try the last step (as shown below) I get a "Invalid Class String"
....this tells me for some reason my VB6 wrapper didnt get registered..
I tried physically registering it and it shows up in the registry.

Any and all help appreciated!

Thanks
HS
DECLARE @comHandle INT
DECLARE @retVal INT
DECLARE @errorSource VARCHAR(100)
DECLARE @errorDescription VARCHAR(100)
DECLARE @helloString VARCHAR(200)

EXEC @retVal = sp_OACreate 'HelloDNA.Class1', @comHandle OUTPUT
IF (@retVal <> 0)
BEGIN
EXEC sp_OAGetErrorInfo @comHandle, @errorSource OUTPUT, @errorDescription
OUTPUT
SELECT @errorSource, @errorDescription
END
http://www.sqljunkies.com/Article/C5...A342CAAAB.scuk
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* "H S" <hs*****@yahoo.com> scripsit:
Has anybody tried doing this?? I followed this article to the T, but still
have problems in the last step..
When I try the last step (as shown below) I get a "Invalid Class String"
...this tells me for some reason my VB6 wrapper didnt get registered..
I tried physically registering it and it shows up in the registry.


Are you sure you are talking about VB.NET? If not, consider turning to
one of the microsoft.public.vb.* groups.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
Bob
Look in microsoft.public.sqlserver.programming for the thread "Using DLL's".
The answer is basically, "don't do it".

In summary, accessing a DotNet assembly from SQL Server is possible but
also:

1. not simple
2. not supported
3. dangerous

HTH,
Bob

"H S" <hs*****@yahoo.com> wrote in message
news:eo*************@TK2MSFTNGP12.phx.gbl...
Hi all,
Has anybody tried doing this?? I followed this article to the T, but still
have problems in the last step..
When I try the last step (as shown below) I get a "Invalid Class String"
...this tells me for some reason my VB6 wrapper didnt get registered..
I tried physically registering it and it shows up in the registry.

Any and all help appreciated!

Thanks
HS
DECLARE @comHandle INT
DECLARE @retVal INT
DECLARE @errorSource VARCHAR(100)
DECLARE @errorDescription VARCHAR(100)
DECLARE @helloString VARCHAR(200)

EXEC @retVal = sp_OACreate 'HelloDNA.Class1', @comHandle OUTPUT
IF (@retVal <> 0)
BEGIN
EXEC sp_OAGetErrorInfo @comHandle, @errorSource OUTPUT, @errorDescription OUTPUT
SELECT @errorSource, @errorDescription
END
http://www.sqljunkies.com/Article/C5...A342CAAAB.scuk


Nov 20 '05 #3

P: n/a
H S
Yes Herfried : I am talking about VB.Net classes. Here's the article that
describes how to do it.
http://www.sqljunkies.com/Article/C5...A342CAAAB.scuk

Bob: Looking at the article I thought it was pretty staright forward..
Is there another way of doing this or that I can't use DLLs in SQL server
at all?? This doesn't seem plausible.

Thanks
HS

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uE**************@TK2MSFTNGP10.phx.gbl...
* "H S" <hs*****@yahoo.com> scripsit:
Has anybody tried doing this?? I followed this article to the T, but still have problems in the last step..
When I try the last step (as shown below) I get a "Invalid Class String" ...this tells me for some reason my VB6 wrapper didnt get registered..
I tried physically registering it and it shows up in the registry.


Are you sure you are talking about VB.NET? If not, consider turning to
one of the microsoft.public.vb.* groups.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #4

P: n/a
Bob
It looks like the article you refer to was written more recently than when I
last looked into the matter, so maybe it's OK to do, sorry I don't have any
specific advice on the problem you're having since I won't test it. Just
remember (you probably know this already) that you can crash SQL Server
itself if your DLL throws any unhandled exceptions; considering what you're
trying to do (regardless of method) is essentially a hack, I wanted to relay
to you a Word Of Caution.

Bob

"H S" <hs*****@yahoo.com> wrote in message
news:O%****************@TK2MSFTNGP12.phx.gbl...
Yes Herfried : I am talking about VB.Net classes. Here's the article that
describes how to do it.
http://www.sqljunkies.com/Article/C5...A342CAAAB.scuk
Bob: Looking at the article I thought it was pretty staright forward..
Is there another way of doing this or that I can't use DLLs in SQL server
at all?? This doesn't seem plausible.

Thanks
HS

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uE**************@TK2MSFTNGP10.phx.gbl...
* "H S" <hs*****@yahoo.com> scripsit:
Has anybody tried doing this?? I followed this article to the T, but still have problems in the last step..
When I try the last step (as shown below) I get a "Invalid Class String" ...this tells me for some reason my VB6 wrapper didnt get registered..
I tried physically registering it and it shows up in the registry.


Are you sure you are talking about VB.NET? If not, consider turning to
one of the microsoft.public.vb.* groups.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.