Showing posts with label ole. Show all posts
Showing posts with label ole. Show all posts

Sunday, March 11, 2012

DLL initialization failure using CDOSYS mail

We have a SQL 2000 stored procedure to send notification emails using CDOSYS and OLE Automation. It has been happily sending out emails for quite a while now from both of our dev and prod machines.

The other day I added a line of code to format the message body variable. I tested the change in a T-SQL script in dev, then added the line into the procedure and recompiled it in dev using an ALTER PROC script. I then called the dev proc and everything is still good. The change has no impact to the sp_OA* commands.

So then I used the same ALTER PROC script and pointed it to production. There is no difference between the dev and prod procs so this was OK. The script ran OK and the proc was updated with the change. However, now only the prod proc doesn't work. Further, the same code in a T-SQL script also fails. But everything remains fine in the dev environment.

We restored the database that had the email SP to a point prior to the change, but the problem persists. It is as if recompiling the proc has disabled the CDOSYS capability from SQL server. CDOSYS still works from VBscript on the server.

The error message:

Msg 50000, Level 18, State 3, Procedure usp_SendEmail, Line 154

Error in Email Object: Source: CDO.Configuration.1 . Description: A dynamic link library (DLL) initialization routine failed.

(EOLIAN.Tools.dbo.usp_SendEmail)

Here's a bit of the code:

DECLARE @.iMsg int,

@.hr int

EXEC @.hr = sp_OACreate 'CDO.Message', @.iMsg OUT

IF @.HR <> 0 GOTO Error_Handling

EXEC @.hr = sp_OASetProperty @.iMsg, 'Configuration.fields("http://schemas.microsoft.com/cdo/configuration/sendusing").Value','2'

IF @.HR <> 0 GOTO Error_Handling

I encountered a similar problem a few months ago when we collocated our DB server (Win2K, SQL 2005) and changed the domain it was in. At the time, granting the login that runs the SQL Server service access to the System32/InetSrv directory fixed the problem (seemed to be a metabase access issue). The one difference is that we use the Pickup directory (SendUsing=1).

A few weeks later, things stopped working again. Like you, I've tested using a VBScript logged in as the same account that's running the SQL Server service and the emails gets generated without difficulty. But using the stored proc or a pared-down SQL script generates the same DLL initialization error in CDO.Configuration.1.

This proc has been in use since we converted to SQL 2000 and has not been altered for some time (>12mo). The only change is the domain change which clearly introduced a number of security implications. However, that doesn't explain why it worked and then just stopped working.

If I figure out the problem, I'll post again. If you figure out hte problem, please post as well as we may be chasing the same issue.

|||Moving to the T-SQl group.|||The problem is resolved, although not understood. We rebooted the server and restarted SQL and all is well again. Not sure what caused the problem, or what the problem was.|||The solution was short lived. The DLL initialization failure message is back. :-(

Friday, February 17, 2012

DISTRIBUTED TRANSACTION with OLE DB Jet

Hi,
I set up an Access 2003 MDB file as a linked Server on SQL Server 2000.
I like to use it to sync entries between SQL Server and the MDB Database.
For this purpose I like to use a DISTRIBUTED TRANSACTION.
But this is the result I get when I use COMMIT TRANSACTION at the end.
<eb1>The current transaction could not be exported to the remote provider.
It has been rolled back.
State: 42000, Native: 8524, Source: Microsoft OLE DB Provider for SQL
Server</eb1>
Thanks for any help
Regards
Patrick
Please reply to group, rather than mail ad patrickwolf - netJET does not support distributed transactions, therefore this will always
fail.
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2005 All rights reserved.
"Patrick Wolf" <pwolf@.SeeSig.Invalid> wrote in message
news:OIgjIYOZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I set up an Access 2003 MDB file as a linked Server on SQL Server 2000.
> I like to use it to sync entries between SQL Server and the MDB Database.
> For this purpose I like to use a DISTRIBUTED TRANSACTION.
> But this is the result I get when I use COMMIT TRANSACTION at the end.
> <eb1>The current transaction could not be exported to the remote provider.
> It has been rolled back.
> State: 42000, Native: 8524, Source: Microsoft OLE DB Provider for SQL
> Server</eb1>
> Thanks for any help
> Regards
> Patrick
> --
> Please reply to group, rather than mail ad patrickwolf - net
>|||> JET does not support distributed transactions, therefore this will always
> fail.
Thank you Gert. Its a pity but its good to know :)

Tuesday, February 14, 2012

DISTRIBUTED REQUEST

Sometimes when i try yo execute a distributed request , I am getting this
error
Impossible de démarre une transaction sur le fournisseur OLE DB 'SQLOLEDB'.
[OLE/DB provider returned message: Impossible de créer une nouvelle
transaction en raison d'un dépassement de capacité.]
Trace de l'erreur OLE DB [OLE/DB Provider 'SQLOLEDB'
ITransactionLocal::StartTransaction returned 0x8004d01d: ISOLEVEL=4096].
can you help me .Do you use connection pooling? Sounds like your connection pool has ran
out of connections and your settings disallow the creation of another
connection.
You can check this out easily by checking the # of active connections
with Enterprise manager and compare it to the max pool size.
/Jo
benamerk wrote:

> Sometimes when i try yo execute a distributed request , I am getting this
> error
> Impossible de démarre une transaction sur le fournisseur OLE DB 'SQLOLEDB
'.
> [OLE/DB provider returned message: Impossible de créer une nouvelle
> transaction en raison d'un dépassement de capacité.]
> Trace de l'erreur OLE DB [OLE/DB Provider 'SQLOLEDB'
> ITransactionLocal::StartTransaction returned 0x8004d01d: ISOLEVEL=4096].
> can you help me .