Showing posts with label oledb. Show all posts
Showing posts with label oledb. Show all posts

Thursday, March 29, 2012

Executing Procedure (OLEDB Session Object)

I'm executing a very simple Sotred Procedure from VB6 and I'm getting this error:

"Requested operation requires an OLE DB Session object, which is not supported by the current provider."

I executed it from Query Analyzer and Worked perfectly!

I hope you can help me with this now! :(How are you trying to execute the sp in vb6 - please post your code - including connection string ... ?sql

Wednesday, March 7, 2012

Execute SQL Insert Statement from Script Task using package OLEDB Connection

Is there a way to directly do this in one step(Execute SQL Insert Statement from Script Task using package OLEDB Connection)?

Right now I'm using a script task to build a sql insert statement using package variables (to fill values) populated by certain logic in the package.

Then assigning this command string to a package variable.

Then using a sql execute task to execute this variable.

A link to an article or code would be greatly appreciated.

You can use the classes in the System.Data.OleDB namespace and the ConnectionManager.AquireConnection method to do this. It is easiest to do this if you have an ADO.NET OLEDB connection, as that returns a managed object that you can use in your script task.

See jaegd's post in this thread for a sample. It shows use of the SQL Client, and it's a script transform rather than a task, but hopefully it's enough to get you started. If not, post back and we'll help you resolve any difficulties.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1895867&SiteID=1