Hello,
I've created my own sendmail in VB6 SP5 as a DLL and put it on my SQL server
2K SP3. I've a class module with only one public funtion in it.
I want to use the function in this dll so I decalred my DLL as an extended
proc in SQL . apprently SQL doesn't recognize the function in my dll. How
can I use it? What's the best way to do it?
Best regards,I'm not sure if a VB6 DLL can be registered as an extended stored procedure
this way.
If you want to use the functionality of your DLL from SQL Server, you could
use the sp_OA* set of procedures for the same. Refer to
http://www32.brinkster.com/srisamp/sqlarchives.asp for articles on COM
accessibility. You can refer to the articles titled "Using COM Objects in
SQL Server" and "Extending SQL Server with COM Objects".
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"Philippe RUELLO" <pruello@.tibco.fr> wrote in message
news:OMjpLlYuDHA.2712@.tk2msftngp13.phx.gbl...
> Hello,
> I've created my own sendmail in VB6 SP5 as a DLL and put it on my SQL
server
> 2K SP3. I've a class module with only one public funtion in it.
> I want to use the function in this dll so I decalred my DLL as an extended
> proc in SQL . apprently SQL doesn't recognize the function in my dll. How
> can I use it? What's the best way to do it?
> Best regards,
>|||Just to confirm - VB only produces COM type .dlls, not call level type which
are required for extended stored procedures. So you cannot register VB .dlls
for use as extended stored procedures in SQL Server.
The other method that SriSamp has suggested (sp_OACreate) is the only way to
access your VB .dll directly from T-SQL.
Regards,
Greg Linwood
SQL Server MVP
"SriSamp" <ssampath@.sct.co.in> wrote in message
news:#j7#xrYuDHA.1576@.TK2MSFTNGP11.phx.gbl...
> I'm not sure if a VB6 DLL can be registered as an extended stored
procedure
> this way.
> If you want to use the functionality of your DLL from SQL Server, you
could
> use the sp_OA* set of procedures for the same. Refer to
> http://www32.brinkster.com/srisamp/sqlarchives.asp for articles on COM
> accessibility. You can refer to the articles titled "Using COM Objects in
> SQL Server" and "Extending SQL Server with COM Objects".
> --
> HTH,
> SriSamp
> Please reply to the whole group only!
> http://www32.brinkster.com/srisamp
> "Philippe RUELLO" <pruello@.tibco.fr> wrote in message
> news:OMjpLlYuDHA.2712@.tk2msftngp13.phx.gbl...
> > Hello,
> > I've created my own sendmail in VB6 SP5 as a DLL and put it on my SQL
> server
> > 2K SP3. I've a class module with only one public funtion in it.
> > I want to use the function in this dll so I decalred my DLL as an
extended
> > proc in SQL . apprently SQL doesn't recognize the function in my dll.
How
> > can I use it? What's the best way to do it?
> > Best regards,
> >
> >
>|||Thanks for the answer.
I tried to use that methos but i've some troubles using the attachements
with CDONT.Newmail
I could use Xp_sendmail, but I want to modify the parameter From.
Have some clues?
"SriSamp" <ssampath@.sct.co.in> a écrit dans le message de
news:%23j7%23xrYuDHA.1576@.TK2MSFTNGP11.phx.gbl...
> I'm not sure if a VB6 DLL can be registered as an extended stored
procedure
> this way.
> If you want to use the functionality of your DLL from SQL Server, you
could
> use the sp_OA* set of procedures for the same. Refer to
> http://www32.brinkster.com/srisamp/sqlarchives.asp for articles on COM
> accessibility. You can refer to the articles titled "Using COM Objects in
> SQL Server" and "Extending SQL Server with COM Objects".
> --
> HTH,
> SriSamp
> Please reply to the whole group only!
> http://www32.brinkster.com/srisamp
> "Philippe RUELLO" <pruello@.tibco.fr> wrote in message
> news:OMjpLlYuDHA.2712@.tk2msftngp13.phx.gbl...
> > Hello,
> > I've created my own sendmail in VB6 SP5 as a DLL and put it on my SQL
> server
> > 2K SP3. I've a class module with only one public funtion in it.
> > I want to use the function in this dll so I decalred my DLL as an
extended
> > proc in SQL . apprently SQL doesn't recognize the function in my dll.
How
> > can I use it? What's the best way to do it?
> > Best regards,
> >
> >
>|||How about xp_smtp_sendmail from www.SQLDev.Net?
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Philippe RUELLO" <pruello@.tibco.fr> wrote in message news:uXn1yUZuDHA.2408@.tk2msftngp13.phx.gbl...
> Thanks for the answer.
> I tried to use that methos but i've some troubles using the attachements
> with CDONT.Newmail
> I could use Xp_sendmail, but I want to modify the parameter From.
> Have some clues?
> "SriSamp" <ssampath@.sct.co.in> a écrit dans le message de
> news:%23j7%23xrYuDHA.1576@.TK2MSFTNGP11.phx.gbl...
> > I'm not sure if a VB6 DLL can be registered as an extended stored
> procedure
> > this way.
> > If you want to use the functionality of your DLL from SQL Server, you
> could
> > use the sp_OA* set of procedures for the same. Refer to
> > http://www32.brinkster.com/srisamp/sqlarchives.asp for articles on COM
> > accessibility. You can refer to the articles titled "Using COM Objects in
> > SQL Server" and "Extending SQL Server with COM Objects".
> > --
> > HTH,
> > SriSamp
> > Please reply to the whole group only!
> > http://www32.brinkster.com/srisamp
> >
> > "Philippe RUELLO" <pruello@.tibco.fr> wrote in message
> > news:OMjpLlYuDHA.2712@.tk2msftngp13.phx.gbl...
> > > Hello,
> > > I've created my own sendmail in VB6 SP5 as a DLL and put it on my SQL
> > server
> > > 2K SP3. I've a class module with only one public funtion in it.
> > > I want to use the function in this dll so I decalred my DLL as an
> extended
> > > proc in SQL . apprently SQL doesn't recognize the function in my dll.
> How
> > > can I use it? What's the best way to do it?
> > > Best regards,
> > >
> > >
> >
> >
>
Showing posts with label public. Show all posts
Showing posts with label public. Show all posts
Sunday, March 11, 2012
Friday, March 9, 2012
Divide by zero
I'm using Toolman's Public function and it's working as far as the divide by
zero, however, I'm trying to get a percentage. When I pass the two
parameters to it, if the result is 100.% it shows up. If it's anything else,
it shows 0.0%. Here is the function and the code.
Public Function DivideBy(ByVal exp1, ByVal exp2)
If exp1 = 0 Then
DivideBy = 0
Else
DivideBy = exp1 / exp2
End If
End Function
=code.DivideBy
( Fields!Under120_1.Value, Fields!TotalRecs.Value )
Any help is appreciated.
--
Thanks!Sounds like a datatype issue, maybe there is a conversion to int in your
expression?
I tried the expression:
=Code.DivideBy(5, 100) * 100
and it doesn't return zero or 100.
I wrapped a CInt() around it and I get that behavior.:
=CInt(Code.DivideBy(5, 100))
The CInt forces either a 0 or 1, then it's converted to percent.
"Candy" <Candy@.discussions.microsoft.com> wrote in message
news:3BBFBF2E-EAEB-4103-BC70-E81C14AE537F@.microsoft.com...
> I'm using Toolman's Public function and it's working as far as the divide
> by
> zero, however, I'm trying to get a percentage. When I pass the two
> parameters to it, if the result is 100.% it shows up. If it's anything
> else,
> it shows 0.0%. Here is the function and the code.
> Public Function DivideBy(ByVal exp1, ByVal exp2)
> If exp1 = 0 Then
> DivideBy = 0
> Else
> DivideBy = exp1 / exp2
> End If
> End Function
> =code.DivideBy
> ( Fields!Under120_1.Value, Fields!TotalRecs.Value )
> Any help is appreciated.
> --
> Thanks!|||Try CDbl() instead of CInt()
Also, make sure the values being passed are not integer values
zero, however, I'm trying to get a percentage. When I pass the two
parameters to it, if the result is 100.% it shows up. If it's anything else,
it shows 0.0%. Here is the function and the code.
Public Function DivideBy(ByVal exp1, ByVal exp2)
If exp1 = 0 Then
DivideBy = 0
Else
DivideBy = exp1 / exp2
End If
End Function
=code.DivideBy
( Fields!Under120_1.Value, Fields!TotalRecs.Value )
Any help is appreciated.
--
Thanks!Sounds like a datatype issue, maybe there is a conversion to int in your
expression?
I tried the expression:
=Code.DivideBy(5, 100) * 100
and it doesn't return zero or 100.
I wrapped a CInt() around it and I get that behavior.:
=CInt(Code.DivideBy(5, 100))
The CInt forces either a 0 or 1, then it's converted to percent.
"Candy" <Candy@.discussions.microsoft.com> wrote in message
news:3BBFBF2E-EAEB-4103-BC70-E81C14AE537F@.microsoft.com...
> I'm using Toolman's Public function and it's working as far as the divide
> by
> zero, however, I'm trying to get a percentage. When I pass the two
> parameters to it, if the result is 100.% it shows up. If it's anything
> else,
> it shows 0.0%. Here is the function and the code.
> Public Function DivideBy(ByVal exp1, ByVal exp2)
> If exp1 = 0 Then
> DivideBy = 0
> Else
> DivideBy = exp1 / exp2
> End If
> End Function
> =code.DivideBy
> ( Fields!Under120_1.Value, Fields!TotalRecs.Value )
> Any help is appreciated.
> --
> Thanks!|||Try CDbl() instead of CInt()
Also, make sure the values being passed are not integer values
Subscribe to:
Posts (Atom)