Unable To Cast COM Object Of Type 'ADODB.CommandClass' To Interface Type 'ADODB._Command'

Dec 20, 2006

I have an application which runs successfully on a couple of my customer's machines but fails on a third. It seems to fail when opening the database:

Unable to cast COM object of type 'ADODB.CommandClass' to interface type 'ADODB._Command'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B08400BD-F9D1-4D02-B856-71D5DBA123E9}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=false; Initial Catalog=lensdb;Data Source = SQL

Before I got this error I was getting another problem (sorry didn't make a copy of that error's text) that made me think that adodb.dll simply wasn't loaded/registered. I got rid of that error by copying my adodb.dll onto the third machine and running gacutil /i. There is now an entry in winntassemblies for adodb.

Just in case you think it could be an obvious registry problem: when I started getting the current error I thought that maybe the registry needed updating and I merged the following lines into onto the target machine (from my dev machine):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOTInterface{B08400BD-F9D1-4D02-B856-71D5DBA123E9}]
@="_Command"

[HKEY_CLASSES_ROOTInterface{B08400BD-F9D1-4D02-B856-71D5DBA123E9}ProxyStubClsid]
@="{00020424-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOTInterface{B08400BD-F9D1-4D02-B856-71D5DBA123E9}ProxyStubClsid32]
@="{00020424-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOTInterface{B08400BD-F9D1-4D02-B856-71D5DBA123E9}TypeLib]
@="{EF53050B-882E-4776-B643-EDA472E8E3F2}"
"Version"="2.7"

[HKEY_LOCAL_MACHINESOFTWAREClassesInterface{B08400BD-F9D1-4D02-B856-71D5DBA123E9}]
@="_Command"

[HKEY_LOCAL_MACHINESOFTWAREClassesInterface{B08400BD-F9D1-4D02-B856-71D5DBA123E9}ProxyStubClsid]
@="{00020424-0000-0000-C000-000000000046}"

[HKEY_LOCAL_MACHINESOFTWAREClassesInterface{B08400BD-F9D1-4D02-B856-71D5DBA123E9}ProxyStubClsid32]
@="{00020424-0000-0000-C000-000000000046}"

[HKEY_LOCAL_MACHINESOFTWAREClassesInterface{B08400BD-F9D1-4D02-B856-71D5DBA123E9}TypeLib]
@="{EF53050B-882E-4776-B643-EDA472E8E3F2}"
"Version"="2.7"


but, no change alas.

All three machines are running Windows 2000.

Any advice would be appreciated.

Thanks in advance,

Ross

View 1 Replies


ADVERTISEMENT

Script Component Has Encountered An Exception In User Code - Object Is Not An ADODB.RecordSet Or An ADODB.Record

Nov 26, 2007

hi have written SSIS script and i am using script component to Row count below my code what i have written. and i am getting error below i have mention...after code see the error
using System;

using System.Data;

using Microsoft.SqlServer.Dts.Pipeline.Wrapper;

using Microsoft.SqlServer.Dts.Runtime.Wrapper;

using System.Data.SqlClient;

using System.Data.OleDb;



[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]

public class ScriptMain : UserComponent

{

IDTSConnectionManager100 connMgr;

OleDbConnection sqlConn = null;

OleDbDataReader sqlReader;



public override void AcquireConnections(object Transaction)

{

connMgr = this.Connections.MyConnection;

sqlConn = (OleDbConnection )connMgr.AcquireConnection(null);

//sqlConn = (SqlConnection)connMgr.AcquireConnection(null);

}

public override void PreExecute()

{

base.PreExecute();

/*

Add your code here for preprocessing or remove if not needed

*/

OleDbCommand cmd = new OleDbCommand("SELECT CustomerID,TerritoryID,AccountNumber,CustomerType FROM Sales.Customer", sqlConn);



sqlReader = cmd.ExecuteReader();

}

public override void PostExecute()

{

base.PostExecute();

/*

Add your code here for postprocessing or remove if not needed

You can set read/write variables here, for example:

Variables.MyIntVar = 100

*/

}

public override void CreateNewOutputRows()

{

/*

Add rows by calling the AddRow method on the member variable named "<Output Name>Buffer".

For example, call MyOutputBuffer.AddRow() if your output was named "MyOutput".

*/

System.Data.OleDb.OleDbDataAdapter oLead = new System.Data.OleDb.OleDbDataAdapter();

//SqlDataAdapter oLead = new SqlDataAdapter();

DataSet ds = new DataSet();



System.Data.DataTable dt = new System.Data.DataTable();

//DataRow row = new DataRow();

oLead.Fill(dt,this.Variables.ObjVariable);





foreach (DataRow row in dt.Rows)

{

{

Output0Buffer.AddRow();

Output0Buffer.CustomerID = (int)row["CustomerID"];

Output0Buffer.TerritoryID =(int)row["TerritoryID"];

Output0Buffer.AccountNumber = row["AccountNumber"].ToString();

Output0Buffer.CustomerType = row["CustomerType"].ToString();

}

}



}

}
the error
Script component has encountered an exception in user code
Object is not an ADODB.RecordSet or an ADODB.Record.
Parameter name: adodb
at System.Data.OleDb.OleDbDataAdapter.FillFromADODB(Object data, Object adodb, String
srcTable, Boolean multipleResults)
at System.Data.OleDb.OleDbDataAdapter.Fill(DataTable dataTable, Object ADODBRecordSet)
at ScriptMain.CreateNewOutputRows()
at UserComponent.PrimeOutput(Int32 Outputs, Int32[] OutputIDs, PipelineBuffer[] Buffers)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs,
Int32[] outputIDs, PipelineBuffer[] buffers)

thanks
kedarnath

View 4 Replies View Related

Unable To Cast Object Of Type 'System.Object' To Type 'System.Data.DataSet'.

Nov 27, 2007



hi i dont know how to do type casting.

this.Variables.ObjVariable this objVariables i have create in variable place below like this



Name:Variable datatype int32 values 0

Name: NumberofRowsdatatype int32 values 10000

Name: ObjVariable datatype Object



My code





public override void CreateNewOutputRows()

{

/*

Add rows by calling the AddRow method on the member variable named "<Output Name>Buffer".

For example, call MyOutputBuffer.AddRow() if your output was named "MyOutput".

*/

System.Data.OleDb.OleDbDataAdapter oLead = new System.Data.OleDb.OleDbDataAdapter();

//System.Data.Odbc.OdbcDataAdapter oLead = new System.Data.Odbc.OdbcDataAdapter();

//SqlDataAdapter oLead = new SqlDataAdapter();

System.Data.DataTable dt = new System.Data.DataTable();

DataSet ds = (DataSet)this.Variables.ObjVariable; // here i am getting error

ds.Tables.Add(dt);


ADODB.Record rs = new ADODB.Record();



oLead.Fill(ds, rs, "Variables");

foreach (DataRow row in dt.Rows)

{

{

Output0Buffer.AddRow();

Output0Buffer.Column = (int)row["Column"];

Output0Buffer.Column1 = row["Column1"].ToString();

Output0Buffer.Column2 = row["Column2"].ToString();

}

}


}

}

This is the error

Unable to cast object of type 'System.Object' to type 'System.Data.DataSet'.

at ScriptMain.CreateNewOutputRows()

at UserComponent.PrimeOutput(Int32 Outputs, Int32[] OutputIDs, PipelineBuffer[] Buffers)

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)



thanks

kedaranth

View 5 Replies View Related

SqlDataSource.Select Error: Unable To Cast Object Of Type 'System.Data.DataView' To Type 'System.String'.

Oct 19, 2006

I am trying to put the data from a field in my database into a row in a table using the SQLDataSource.Select statement. I am using the following code: FileBase.SelectCommand = "SELECT Username FROM Files WHERE Filename = '" & myFileInfo.FullName & "'" myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments()), String)But when I run the code, I get the following error:Server Error in '/YorZap' Application. Unable to cast object of type 'System.Data.DataView' to type 'System.String'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Data.DataView' to type 'System.String'.Source Error: Line 54: FileBase.SelectCommand = "SELECT Username FROM Files WHERE Filename = '" & myFileInfo.FullName & "'"
Line 55: 'myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments).GetEnumerator.Current, String)
Line 56: myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments()), String)
Line 57:
Line 58: filesTable.Rows.Add(myDataRow)Source File: D:YorZapdir_list_sort.aspx    Line: 56 Stack Trace: [InvalidCastException: Unable to cast object of type 'System.Data.DataView' to type 'System.String'.]
ASP.dir_list_sort_aspx.BindFileDataToGrid(String strSortField) in D:YorZapdir_list_sort.aspx:56
ASP.dir_list_sort_aspx.Page_Load(Object sender, EventArgs e) in D:YorZapdir_list_sort.aspx:7
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +45
System.Web.UI.Control.OnLoad(EventArgs e) +80
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3743
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210 Please help me!

View 3 Replies View Related

Unable To Cast COM Object Of Type 'System.__ComObject' To Class Type 'System.Data.SqlClient.SqlConn

May 17, 2006

Dear all,

I am stuck with a SSIS package and I can€™t work out. Let me know what steps are the correct in order to solve this.
At first I have just a Flat File Source and then Script Component, nothing else.

Error:





[Script Component [516]] Error: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.SqlClient.SqlConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface. at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.AcquireConnections(Object transaction) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)



Script Code (from Script Component):



' Microsoft SQL Server Integration Services user script component
' This is your new script component in Microsoft Visual Basic .NET
' ScriptMain is the entrypoint class for script components

Imports System
Imports System.Data.SqlClient
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper


Public Class ScriptMain
Inherits UserComponent


Dim nDTS As IDTSConnectionManager90
Dim sqlConnecta As SqlConnection
Dim sqlComm As SqlCommand
Dim sqlParam As SqlParameter


Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Dim valorColumna As String
Dim valorColumna10 As Double


valorColumna = Row.Column9.Substring(1, 1)

If valorColumna = "N" Then
valorColumna10 = -1 * CDbl(Row.Column10 / 100)
Else
valorColumna10 = CDbl(Row.Column10 / 100)
End If

Me.Output0Buffer.PORCRETEN = CDbl(Row.Column11 / 100)
Me.Output0Buffer.IMPRETEN = CDbl(Row.Column12 / 100)
Me.Output0Buffer.EJERCICIO = CInt(Row.Column2)
Me.Output0Buffer.CODPROV = CInt(Row.Column7)
Me.Output0Buffer.MODALIDAD = CInt(Row.Column8)
Me.Output0Buffer.NIFPERC = CStr(Row.Column3)
Me.Output0Buffer.NIFREP = CStr(Row.Column4)
Me.Output0Buffer.NOMBRE = CStr(Row.Column6)
Me.Output0Buffer.EJERDEV = CDbl(Row.Column13)

With sqlComm
.Parameters("@Ejercicio").Value = CInt(Row.Column2)
.Parameters("@NIFPerc").Value = CStr(Row.Column3)
.Parameters("@NIFReP").Value = CStr(Row.Column4)
.Parameters("@Nombre").Value = CStr(Row.Column6)
.Parameters("@CodProv").Value = CInt(Row.Column7)
.Parameters("@Modalidad").Value = CInt(Row.Column8)
.Parameters("@ImpBase").Value = valorColumna10
.Parameters("@PorcReten").Value = CDbl(Row.Column11 / 100)
.Parameters("@ImpReten").Value = CDbl(Row.Column12 / 100)
.Parameters("@EjerDev").Value = CDbl(Row.Column13)

.ExecuteNonQuery()
End With


End Sub
Public Overrides Sub AcquireConnections(ByVal Transaction As Object)

Dim nDTS As IDTSConnectionManager90 = Me.Connections.TablaMODELO80
sqlConnecta = CType(nDTS.AcquireConnection(Nothing), SqlConnection)

End Sub
Public Overrides Sub PreExecute()

sqlComm = New SqlCommand("INSERT INTO hac_modelo180(Ejercicio,NIFPerc,NIFReP,Nombre,CodProv,Modalidad,ImpBase,PorcReten,ImpReten,EjerDev) " & _
"VALUES(@Ejercicio,@NIFPerc,@NIFReP,@Nombre,@CodProv,@Modalidad,@ImpBase,@PorcReten,@ImpReten,@EjerDev)", sqlConnecta)
sqlParam = New SqlParameter("@Ejercicio", Data.SqlDbType.SmallInt)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@NIFPerc", Data.SqlDbType.Char)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@NIFReP", Data.SqlDbType.Char)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@Nombre", Data.SqlDbType.VarChar)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@CodProv", Data.SqlDbType.TinyInt)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@Modalidad", Data.SqlDbType.SmallInt)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@ImpBase", Data.SqlDbType.Decimal)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@PorcReten", Data.SqlDbType.Decimal)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@ImpReten", Data.SqlDbType.Decimal)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@EjerDev", Data.SqlDbType.Decimal)
sqlComm.Parameters.Add(sqlParam)

End Sub


Public Sub New()

End Sub
Public Overrides Sub ReleaseConnections()
nDts.ReleaseConnection(sqlConnecta)
End Sub

Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub
End Class







Thanks a lot for your help


View 13 Replies View Related

@PARAM1 : Unable To Cast Object Of Type 'System.Data.SqlTypes.SqlInt32 To Type System.IConvertable

Apr 23, 2007

I get the following message in the vs2005 querybuilder when i do a preview:



***********************************
SQL Execution Error.

Executed SQL statement: SELECT Schoolindex, Variant, VVSchool, [index], indincl, VVRuimtes, School FROM School WHERE (Schoolindex = @PARAM1)



Error Source: SQL Server Compact Edition ADO.NET Data Provider


Error Message: @PARAM1 : Unable to cast object of type 'System.Data.SqlTypes.SqlInt32 to type System.IConvertable'.
****************************************

The same querypreview works fine without the parameter:



SELECT Schoolindex, Variant, VVSchool, [index], indincl, VVRuimtes, School FROM School WHERE (Schoolindex = 186)



Can anybody tell me why this is?
And tell me a way to get the tableadapter working?



Anne-Jan Tuinstra

View 3 Replies View Related

Unable To Cast Object Of Type 'System.String' To Type 'System.Web.UI.WebControls.Parameter'.

Jun 19, 2008

I'm getting this error on a vb.net page the needs to execute two separate stored procedures.  The first one, is the main insert, and returns the identity value for the ClientID.  The second stored procedure inserts data, but needs to insert the ClientID returned in the first stored procedure.  What am I doing wrong with including the identity value "ClientID" in the second stored procedure? 
Unable to cast object of type 'System.String' to type 'System.Web.UI.WebControls.Parameter'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Web.UI.WebControls.Parameter'.Source Error:




Line 14: If li.Selected Then
Line 15: InsertClientCompanyType.InsertParameters("CompanyTypeID").DefaultValue = li.Value
Line 16: InsertClientCompanyType.InsertParameters("ClientID") = ViewState("ClientID")
Line 17:
Line 18:
Source File: C:InetpubwwwrootIntranetExternalAppsNewEmploymentClientNewClient.aspx.vb    Line: 16
Here is my code behind... What am I doing wrong with grabbing the ClientID from the first stored procedure insert? 
 
Protected Sub InsertNewClient_Inserted(ByVal sender As Object, ByVal e As SqlDataSourceStatusEventArgs)ClientID.Text = e.Command.Parameters("@ClientID").Value.ToString()ViewState("ClientID") = e.Command.Parameters("@ClientID").Value.ToString()End SubProtected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Submit.ClickInsertNewClient.Insert()For Each li As ListItem In CompanyTypeID.Items
If li.Selected ThenInsertClientCompanyType.InsertParameters("CompanyTypeID").DefaultValue = li.ValueInsertClientCompanyType.InsertParameters("ClientID") = ViewState("ClientID")InsertClientCompanyType.Insert()End IfNextEnd Sub

View 2 Replies View Related

Unable To Cast Object Of Type 'System.DBNull' To Type 'System.Byte[]'.

Aug 13, 2007

Hi,
I have developed a custom server control for .NET Framework 2.0. The server control has a property named BinaryData of type byte[]. I marked this property to be data bindable. Now, I have varbinary(Max) type of field in my SQL Database and I have used SQLDataSource and bound this varbinary(Max) field with the property BinaryData (byte[]) of my control. It is working fine as long as the data value is not NULL. Now, In my control, I have handled the NULL value so that no Exception is thrown. Still, when I bind this property using the SQLDataSource, I get Error "Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'." I am not sure if I can do anything to stop this erro within my control. If it is not possible from the control, then what is the workaround that I can do in my ASPX page in order to stop this error ?
Thanks a lot in advance.

View 10 Replies View Related

Unable To Cast Object Of Type 'System.DateTime' To Type 'System.String'.

Dec 31, 2007

 Hi,      I got this field (dateSubmitted) having a data type of DateTime but I receive this error "Unable to cast object of type 'System.DateTime' to type 'System.String'."       All value for dateSubmitted field are 12/27/2007 12:00:00 AM. cheers,imperialx 

View 3 Replies View Related

Unable To Cast Object Of Type 'System.Xml.XmlTextReaderImpl'

Jul 2, 2007

I'm getting the following error:  Unable to cast object of type 'System.Xml.XmlTextReaderImpl' to type 'System.Xml.XmlTextReader'. This works in .net 1.1 but having issues in the conversion to 2.0.
Public Function RunSPReturnXMLReader(ByVal strSP As String, ByVal ParamArray params() As SqlParameter) As System.Xml.XmlTextReader
Dim objHelperConnection As SqlConnectionobjHelperConnection = New SqlConnection(sConnect)Dim myXmlReader As System.Xml.XmlReader = objHelperCommand.ExecuteXmlReader()
RunSPReturnXMLReader = myXmlReader - GETTING ERROR HERE
End Function
 
Thanks...

View 10 Replies View Related

Unable To Cast Object Of Type 'System.String' Error Help

Aug 1, 2007

Unable to cast object of type 'System.String' to type 'System.Web.UI.DataSourceSelectArguments'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Web.UI.DataSourceSelectArguments'. 
Hi, In my pageload i have data retriving from a page and i want it to load it in the GridView. i have GridView and SqlDataSource but when the page loads i am getting the above error. i am not sure what im doing wrong here. i tried different ways. but no luck Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Thenfp = CType(Context.Handler, Member)
'lblEmail.Text = fp.EMM.ToString
'this labelbox for Email address is under the Name'lblEmail.Text = fp.EmailAddress.ToString
 
 Dim conn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("imacstestConnectionString").ConnectionString)
Dim cmd As SqlCommand = New SqlCommand("SELECT , [fname], [mname], [lname], [address], [city], [state], [zip], [phone] FROM [t_CustomerAcct] WHERE = @email", conn)cmd.Parameters.AddWithValue("@email", fp.EMM.ToString)
conn.Open()
SqlDataSource1.Select(cmd.ExecuteScalar())
'.ExecuteScalar()
 
conn.Close()
End If
End Sub

View 1 Replies View Related

How To Fix Unable To Cast Object Of Type 'Microsoft.SqlServer.Management.Smo.Urn'

Jan 25, 2008

In Sql Server 2005, Sql Server Mangerment Studio 9.00.1399.00
I connected an user instance to the databases under .SQLEXPRESS(SqlServer 9.0.3042 -....)
when I right click on a table
and chose modify, or new table...
I get

TITLE: Microsoft SQL Server Management Studio
------------------------------
Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.Urn' to type 'Microsoft.SqlServer.Management.Smo.Urn'. (SQLEditors)
------------------------------
BUTTONS:
OK
------------------------------

same thing for views
What can I do to fix the problem? is there a patch?



btw script .... as seem to be erro free Error free is also View dependence,

View 3 Replies View Related

Open SSIS Project Error: Unable To Cast COM Object Of Type

Oct 4, 2006

When I open up my existing SSIS project, I always get this error. Does anyone know what was wrong ?



TITLE: Microsoft Visual Studio
------------------------------

Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.IObjectWithSite'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FC4801A3-2BA9-11CF-A229-00AA003D7352}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

View 32 Replies View Related

Vista ADODB Recordset Can't Create ActiveX Object

Jul 19, 2007

Somehow, (I think the user ran a registry cleaner) on Vista, I can no longer create an adodb recordset object.



The app is a VB6 app that works fine on my own Vista Ultimate, my XP boxes and about everthing else prior, but not on the one Vista Home Premium.



I get Error 429 ... Cannot Create ActiveX Object when creating a new adodb.recordset object.



I guess what I need is a way to repair the Vista Home-P machine without having to wipe it.



I see that MDAC_Typ is not recommended as a fix.



I'm at a loss on this one.



View 3 Replies View Related

CS0266: Cannot Implicitly Convert Type 'object' To 'bool'. An Explicit Conversion Exists (are You Missing A Cast?)

Apr 20, 2008

Using OnSelected on the SqlDataSource----here is my currect code:private void On_Load(Object sender, SqlDataSourceCommandEventArgs e){if (e.Command.Parameters["@DueDate"].Value = "NULL"){e.Command.Parameters["@DueDate"].Value = "0000-00-00 00:00:00.000";}}
I am trying to change the value from  NULL(in a datetime field) to "0000-00-00 00:00:00.000" for use on the page.Any ideas, suggestions, or thoughts would be greatly appreciated!
,Gary"we truly fail, only when we quit."

View 2 Replies View Related

SQL 2012 :: Unable To Cast COM Object

Dec 31, 2014

I have already registered the Dts.dll, but it did not make any change, also I have update the visual studio to latest update 4.I have registered the dll by using CMD to the below location and entering regsvr32 dts.dll, it brought up a popup message saying the dll the has been registered.

C:Program FilesMicrosoft SQL Server100DTSBinn

But the issue remains the same, I have to click ok on the popup msg for about 20-30 times to make it go away and the dtsx package in the solution work just fine after closing the pop up.

unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSObject100'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{203E24BD-5203-4C76-AFC7-7C8545EBA1A0}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)). (Microsoft Visual Studio)

View 4 Replies View Related

SSIS Error: Unable To Cast COM Object

Oct 10, 2007

Hi,

I get the following error opening an existing (or working) ssis package on my new server.

Error loading 'TestExecutionFromScript.dtsx' : Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSContainer90'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{8BDFE892-E9D8-4D23-9739-DA807BCDC2AC}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))..

I found in a blog that this is caused due to a dll which is not registered ("DTS.dll")

Can anyone try to explain the exact reason for this? I am not even able to execute a package from the command prompt using the dtexec utility. I have "Microsoft SQL Server Analysis Services Designer Version 9.00.3042.00" on my server. My other machine which executed this package successfully was running "Microsoft SQL Server Analysis Services Designer Version 9.00.1399.00".

Thanks very much for any kind of help.

View 3 Replies View Related

Integration Services :: Unable To Cast Object

Aug 21, 2015

Trying to move data in Sybase IQ from one database (prod) to qa for a table. Using ADO.NET connection and just one Data Flow task , source , destination. Using Sybase IQ driver.

Error:[ADO NET Destination [2]] Error: An exception has occurred during data insertion, the message returned from the provider is: Unable to cast object of type 'System.Decimal' to type 'System.Char[]'.

Nether source or target table have column with data type Decimal or Char. All types I have in table are numeric (54,15) , bigint, varchar, date.  

View 5 Replies View Related

Type Cast In Sql Query

Mar 17, 2008

Hello friends,
I am working on web application using sql server 2000, visual Studio 2005. In one of the table I have field 'NetAmount' purposely I had kept datatype as char. Now I want to update that field. for e.g. I have to add 100 to netAmount. How I can do it with sql query. Please let me know.
Thanks & RegardsGirish Nehte

View 1 Replies View Related

ADODB And ActiveX

Jan 19, 2000

Hi,

Am having trouble writing to a table on the SQL 7 Server database, using a DTS ActiveX script.

When I try a .ADDNEW function, the following error comes up.
"The opperation required by the application is not supported by the provider."

The line preceding the .ADDNEW are as follows.
-----
SET Conn=CreateObject("ADODB.Connection")
SET RS = CreateObject("ADODB.RecordSet")
Conn.ConnectionString = "PROVIDER=SQLOLEDB;DATABASE=DataIn;User ID=sa;Password="
Conn.Open
RS.Open sqlSites, Conn
----

Q - Whats wrong ?

View 1 Replies View Related

DAO To ADODB Conversion?

Oct 25, 2013

I currently have an access database that is being converted to strictly a Front-End and SQL as the back-end. simple code conversion from DAO to ADODB? I would be very grateful for the infinite wisdom that resides within these boards.

Option Compare Database
Public LngLoginId As Long
Function LogMeIn(sUser As Long)
'/Go to the users table and record that the user has logged in
'/and which computer they have logged in from
Dim Rs As DAO.Recordset

[Code] ....

View 9 Replies View Related

Errors (ADODB)

Sep 3, 2007



Hi ! I'm using adodb in my program (Visual Basic)

I'm controlling the records with sql in a timer..Timer Interval = 7000

But i am getting some errors sometimes


Connectionwrite(send())

connectionwrite(recv())

It's often working non-problem but sometimes i am getting above errors

What are theese? and how can i solve this problem?

Thanks.

View 1 Replies View Related

ADODB To TextBox

Apr 5, 2007

First time poster, I am using MS Access and I have used the following code to get some data. It is as follows:






Code Snippet

Private Sub FillGUI()
On Error Resume Next



Dim myRS2 As New ADODB.Recordset



myRS2.ActiveConnection = CurrentProject.Connection
myRS2.CursorType = adOpenDynamic
myRS2.LockType = adLockOptimisticd
myRS2.Open "SELECT E.SSN, E.LNAME, SUM(W.HOURS) FROM EMPLOYEE E, WORKS_ON W WHERE (E.SSN = W.ESSN)GROUP BY E.SSN, E.LNAME HAVING(SUM(HOURS)) < 40"

MsgBox (myRS2.GetString)
myRS2.MoveFirst

End Sub





and I have the following output:



http://www.angelfire.com/oh5/ohiostate120/untitled1.JPG



This is what I want. However I need this to be in a text box so I have the following code:






Code Snippet

Private Sub FillGUI()
On Error Resume Next



Dim myRS2 As New ADODB.Recordset



myRS2.ActiveConnection = CurrentProject.Connection
myRS2.CursorType = adOpenDynamic
myRS2.LockType = adLockOptimisticd
myRS2.Open "SELECT E.SSN, E.LNAME, SUM(W.HOURS) FROM EMPLOYEE E, WORKS_ON W WHERE (E.SSN = W.ESSN)GROUP BY E.SSN, E.LNAME HAVING(SUM(HOURS)) < 40"

Me.txtEmployee.SetFocus
Me.txtEmployee.Text = myRS2.GetString
myRS2.MoveFirst

End Sub






And i get this:



http://www.angelfire.com/oh5/ohiostate120/untitled2.JPG




How can I get the text box format to look like the msgbox format? Thanks.........

View 2 Replies View Related

Textbox With ADODB

Apr 5, 2007

First time poster, I am using MS Access and I have used the following code to get some data. It is as follows:






Code Snippet

Private Sub FillGUI()
On Error Resume Next



Dim myRS2 As New ADODB.Recordset



myRS2.ActiveConnection = CurrentProject.Connection
myRS2.CursorType = adOpenDynamic
myRS2.LockType = adLockOptimisticd
myRS2.Open "SELECT E.SSN, E.LNAME, SUM(W.HOURS) FROM EMPLOYEE E, WORKS_ON W WHERE (E.SSN = W.ESSN)GROUP BY E.SSN, E.LNAME HAVING(SUM(HOURS)) < 40"

MsgBox (myRS2.GetString)
myRS2.MoveFirst

End Sub





and I have the following output:



http://www.angelfire.com/oh5/ohiostate120/untitled1.JPG



This is what I want. However I need this to be in a text box so I have the following code:






Code Snippet

Private Sub FillGUI()
On Error Resume Next



Dim myRS2 As New ADODB.Recordset



myRS2.ActiveConnection = CurrentProject.Connection
myRS2.CursorType = adOpenDynamic
myRS2.LockType = adLockOptimisticd
myRS2.Open "SELECT E.SSN, E.LNAME, SUM(W.HOURS) FROM EMPLOYEE E, WORKS_ON W WHERE (E.SSN = W.ESSN)GROUP BY E.SSN, E.LNAME HAVING(SUM(HOURS)) < 40"

Me.txtEmployee.SetFocus
Me.txtEmployee.Text = myRS2.GetString
myRS2.MoveFirst

End Sub






And i get this:



http://www.angelfire.com/oh5/ohiostate120/untitled2.JPG




How can I get the text box format to look like the msgbox format? Thanks

View 1 Replies View Related

Type Cast Problem In SSIS

May 30, 2008

Correct me if i am wrong anywhere.


This is my table structure.


CREATE TABLE [AC].[RUN_PARMS](
[FILE_NAME] [varchar](6) NOT NULL,
[RUN_IND] [bit] NOT NULL,
[GROUP] [varchar](50) NULL,
CONSTRAINT [pk_RUN_PARMS] PRIMARY KEY CLUSTERED
(
[FILE_NAME]
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]


I am using an execute package task in SSIS based on the value of RUN_IND field in RUN_PARMS table. If all the value of RUN_IND field is 0 for all the files in a group, then the execute package task should be enabled else it should be disabled. So i have used the following query.

SELECT SUM(CONVERT(INT,RUN_IND)) AS RUN_IND FROM AC.RUN_PARMS
WHERE [GROUP] = 'FIN'

This will return the value which will be greater than zero. Since i have made the value as 1 for FIN group. Imagine the FIN group has 10 files in it. The output look like,


RUN_IND
10

and

SELECT SUM(CONVERT(INT,RUN_IND)) AS RUN_IND FROM AC.RUN_PARMS
WHERE [GROUP] = 'Ven'

This will return the value which will be equal to zero. Since i have made the value as 0 for Ven group. The output look like,


RUN_IND
0


I have created a variable in the package "user::vardisablepackage".
I have set Resultset as Single for SQL task component
In the package properties (The package which has to be disabled) i have selected property as "Disable" and the expression as @User::vardisablepackage = 0 ?False:True

The problem now is i am not sure what should be the data type for vardisablepackage.
The expression will assign False to Disable property when the RUN_IND = 0.
I am unable to complete this task since i have problem assigning data type for this variable.

Please suggest your views.


Sarvan

View 4 Replies View Related

ADODB Connection With SQL2000SP3

Jul 23, 2005

my code is using ADODB connection to connect to SQL (Virtual) Server.the way it being done is (c++):ADODB::_ConnectionPtr m_dbConn;ADODB::_RecordsetPtr m_dbRst;m_dbConn.CreateInstance(__uuidof(ADODB::Connection ));m_dbRst.CreateInstance( __uuidof( ADODB::Recordset ));m_dbConn->ConnectionString=( L"DSN=mydsn" );m_dbConn->Open("","sa","",-1);lately after installing SP3 over SQL2000, it was impossible to connect- the error message showed: login failed for user 'null)'. reason: notassociated with a trusted sql server connection.so i changed the connection string to:m_dbConn-> ConnectionString =(L"DSN=mydsn; UID=sa; PWD=;");m_dbConn->Open("","","",-1);and now it works !!what is the reason for that ?what in sql SP3 interrupt for this kind of connection ?what is the difference ?

View 1 Replies View Related

ADODB.Command Question

Sep 2, 2006

How to using Adodb.command to get Access file data??
i using this script:

dim connection as new adodb.connection
dim command as new adodb.command
dim recordset as new adodb.recordset

connection.open("connectionstring")
command.activeconnection=connection
command.commandtext="querystring"
recordset=command.execute

but,the Recordset is empty.how to using to get data on Microsoft Access database??



thank!!!!

View 1 Replies View Related

Adodb Recordset Problem

Mar 31, 2006

I am trying to access a table that I know exists and has data. But, when I create a recordset and check for RecordCount, I get a result -1 (no records). When I access the same table (using the same program), it reports (and I can view in a dbgrid) 752580 records exist.

Here's some of the code:

The table is originally copied from another database; I use the following code to be sure the previous connection is closed before proceeding.

  If Not adoRS Is Nothing Then
    If adoRS.State = adStateOpen Then adoRS.Close
    Set adoRS = Nothing
  End If
  If Not DbConn Is Nothing Then
    If DbConn.State = adStateOpen Then DbConn.Close
    Set DbConn = Nothing
  End If

Then a new connection (it works) is opened to access the database with the  copied table:

   strDbConn = "Provider=SQLNCLI;Integrated Security=SSPI;" & _
  "Persist Security Info=False;Database=" & strDbName & ";" & _
  "AttachDBFileName=" & DbPath & ";Data Source=.sqlexpress;" & _
  "User Instance=True"

Next I tried to create the recordset:

  Set adoNewRS = New ADODB.Recordset 'Set OHLC recordset
  Set adoNewRS.ActiveConnection = DestDbConn
  adoNewRS.Open TableName, DestDbConn, adOpenDynamic, adLockOptimistic

Next I try to get the RecordCount:

  NumRecords = adoNewRS.RecordCount

At this point, NumRecords (and adoNewRS.RecordCount) = -1 (even tho I know there are 752580 records in the table).

In the adoNewRS.Open statement, I also tried using the following sql statement:

sSQL = "SELECT * FROM TableName ORDER BY [DateTime];"

It also returns a recordcount = -1.

Anybody have clue?

View 1 Replies View Related

Recover Adodb::_ConnectionPtr

Aug 22, 2007

Most of the the time my connection is created and closed fine.

However, sometimes I get Connection failures (these happen often because I am connecting to the server using a VPN connection). Once I get the connection failure, sometimes I cannot successfully recreate the connection until I kill the application and restart it. Below is my open and release code. I call release anytime the connection fails or a stored procedure fails. If you see anything wrong with it the code below that would prevent the connection from recovering please let me know.

Thanks in advance.




Code Snippet
adodb::_ConnectionPtr m_spConnection;

HRESULT InitializeConnections()
{

HRESULT hr = E_FAIL;
if (m_spConnection && m_spConnection->GetState() == adodb::adStateOpen)
{

hr = S_OK;
}
else
{

if (m_spOperationEvents)
{

const _bstr_t c_bstrEmpty(_T(""));
try
{

CComBSTR bstrInit;
hr = get_DbInitializationString(&bstrInit);
if (!m_spConnection)
{

hr = m_spConnection.CreateInstance(adodb::CLSID_Connection);
}
if(SUCCEEDED(hr))
{


m_spConnection->ConnectionTimeout=30;

hr = m_spConnection->Open((LPCWSTR)bstrInit, c_bstrEmpty, c_bstrEmpty, -1);
}
}
catch (_com_error ce)
{

hr = E_FAIL;
CString strArgs;
strArgs.Format(_T("x%x %s "), ce.Error(), (LPCWSTR)ce.Description());
m_strLastError = GetTranslatedString(eMsgConnectionError, strArgs);
}
catch(HRESULT hrException)
{

hr = hrException;
}
catch(...)
{

hr = E_FAIL;
m_strLastError = GetTranslatedString(eMsgUnknownConnectionError, NULL);
}



}

}
if (!SUCCEEDED(hr))
{

ReleaseConnections();
}
return hr;
}
// Queued thread job to release thread resources
HRESULT CSptAggregation::ReleaseConnections()
{

HRESULT hr = E_FAIL;
try
{

if (m_spConnection)
{

m_spConnection->Cancel();
if (m_spConnection->GetState()== adodb::adStateOpen)

m_spConnection->Close();
}
m_spConnection = NULL;
}
catch (_com_error ce) { hr = E_FAIL; }
catch(...) { hr = E_FAIL; }
return S_OK;
}

View 1 Replies View Related

ADODB Vesion 7.0.3300.0 In Vb.net

Jun 23, 2006

Hi,

I have developed an application in vb.net 2005 Standard Edition and is running fine in my local machine. The executed version of the same application i tried to run in other machine and getting an error as follows :-

" Unable to install application. The application requires the assembly ADODB Version 7.0.3300.0 be installed in the global assembly cache (GAC) first "

Can you somebody help me to solve this problem.

Thanks

Saju John



View 3 Replies View Related

ADODB And Mirrored SQL-Server

Aug 24, 2006


I did setup a Mirrored Database. Connecting from it using ADO.NET works well. It goes to the Mirror if the Principal fails.

But ADODB does not work. I get the error following error:
80004005 Invalid connection string attribute

When trying to connect to the DB in case the principal failed and the mirror is active. (MyProductiveDB is in failover state)

What do I do wrong?


Here is the code:

ADOConn = New ADODB.Connection
ADOConn.Open(CS)

CS is my Connections-String:
"Provider=SQLNCLI.1;Data Source=MyProductiveDB;Failover Partner=MyMirror;Initial Catalog=MyCat;Persist Security Info=True;User ID=MyUser;Password=xxxxxx;Pooling=True;Connect Timeout=5;Application Name=MyApplic"

Remark: When I try to add "Network Library=dbmssocn" to the connection String, I get the same error, even if the Principal is active.

Your help is very much appreciated.
Beat

View 4 Replies View Related

ADODB CommandText Length

Sep 27, 2007

Hi,

I am trying to write a Macro in Excel which would connect to the database and fetch the data for me.

I am using a SQL Query and pass it to a ADODB Command object as adCmdText. The SQL Query is very big, length could be 2500 characters.

I just have read access to the database and do not have a choice to create a Stored Procedure to return a resultset.


When i try to open a recordset with the query, i get a Automation Error.

Is there a Limit on the length of the string i can pass as CommandText?

Regards,
Vikram

View 4 Replies View Related

Timeout Expired With ADODB

Apr 29, 2008

Hi All,

I am using SQL 2005 DB and i connect it using PHP. I have one Store procedure in SQL which requires 1.5 minutes to get result.

I'm always getting error message in web after 30 seconds that Microsoft OLEDB provider for ODBC drivers, timeout expired.

I increased time in php.ini but the error comes from SQL Server. Can you please guide me to increase the time in SQL. so that timeout doesn't expired.
This will help me a lot.

THanks in advance.
GB.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved