Solved

SQL Server 2008 OLE Automation Issues

Posted on 2010-08-15
12
809 Views
Last Modified: 2012-05-10
Hi all,

I have a program here which posts data directly to the tables of an SQL database via OLEDB. In SQL Server 2005 this worked perfectly when OLE Automation was turned on for the server and didn't miss a beat.

However now we have SQL Server 2008 and when I turn on OLE Automation it still fails. The error I am getting is session not opened so it appears  that some security features still need to be changed or switched off. Has anyone got any ideas as to what may be causing the session to fail opening?

Thanks
0
Comment
Question by:auschoc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
12 Comments
 
LVL 7

Expert Comment

by:macentrap
ID: 33442636
Ole Automation in SQL Server 2008 by default is turned off for security reasons. sp_OACreate will start the OLE shared execution environment.

Try this pls!

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO
0
 
LVL 7

Expert Comment

by:macentrap
ID: 33442653
this could also be the issue with SOAP kit

and MS XML version --- for 2008 you would require version 6
0
 

Author Comment

by:auschoc
ID: 33442668
macentrap would that be on the client comptuer or the server computer?

i have tried the first solution without success :(
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Expert Comment

by:macentrap
ID: 33442784
first one will be on server as that where it is turned off.

What error you get there? .....is it still session not open




for XML and SOAP the environment have to be same on server and client.

in program do you also have reference to XML version ???
0
 

Author Comment

by:auschoc
ID: 33442847
hmmm i am not sure that SOAP and XML apply in this instance. Just to give you a heads up as to how the system works

In the registry we setup a string for the program to use for its SQL DB connection

The string is like this

Provider=SQLOLEDB;Server=Testing\SQLEXPRESS2;Uid=sa;Pwd=testing;Database=database

that string is then used within the code to connect to the SQL server and post data when a 'post' button is hit within the product. Would this still be XML/SOAP based? There is no web services involved.
0
 
LVL 7

Expert Comment

by:macentrap
ID: 33442853
also you please update the program you talking about , whats it coded in ?
0
 
LVL 7

Expert Comment

by:macentrap
ID: 33442863
sorry missed your comment, didnt updated...


no it does  not apply on this .

0
 
LVL 7

Expert Comment

by:macentrap
ID: 33442879
are you using 64 bit or 32 bit SQL  and version please
0
 
LVL 7

Expert Comment

by:macentrap
ID: 33442892
please add

Provider=SQLOLEDB;Server=Testing\SQLEXPRESS2;Uid=sa;Pwd=testing;Database=database; Trusted_Connection=True
0
 

Author Comment

by:auschoc
ID: 33442902
Thanks i'll try that and let you know how it goes :)

FYI program is coded in C# with some C++ legacy code.

both 64 bit and 32 bit (We support both) 2008 SQL R2 (Express and Full)
0
 
LVL 7

Accepted Solution

by:
macentrap earned 250 total points
ID: 33442949
0
 

Author Comment

by:auschoc
ID: 33443283
Winner :) Thanks!
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question