ole

Could not convert variant of type (Null) into type (OleStr)

跟風遠走 提交于 2019-12-03 07:22:55
Do you know why the block of code bellow will negate the "Could not convert variant of type (Null) into type (OleStr)" on some computers, not all of them but 3 out of ten computers generate the error message. function GetWMIstringSW(const WMIClass, WMIProperty:string): string; const wbemFlagForwardOnly = $00000020; var FWbemObjectSet: OLEVariant; FWbemObject : OLEVariant; oEnum : IEnumvariant; iValue : LongWord; LNode : TTreeNode; LNode2 : TTreeNode; begin Result:=''; FWbemObjectSet:= FWMIService.ExecQuery(Format('Select %s from %s',[WMIProperty, WMIClass]),'WQL',wbemFlagForwardOnly); oEnum :=

SQL Server 默认跟踪(Default Trace)介绍使用

六眼飞鱼酱① 提交于 2019-12-03 06:29:32
背景 当数据库的表、存储过程经常别修改,当这些修改造成BUG的时候,很多开发都不承认是他们干的,那我们有没办法找出谁干的呢?   SQL Server有Default Trace默认跟踪,数据库记录信息到log.trc文件,可以查看trace_event_id,46表示Create对象(Object:Created),47表示Drop对象(Object:Deleted),93表示日志文件自动增长(Log File Auto Grow),164表示Alter对象(Object:Altered),20表示错误日志(Audit Login Failed)。   虽然可以通过上面的方式找到相关的操作,但是它有两个缺点:     1) log.trc文件是滚动更新文件,所有有可能会被系统删除,你找不了太久的数据;     2) 有些操作你可能是后知后觉,出了问题才会去找问题,我们应该主动去监控这些DDL; 查看默认跟踪信息(Default Trace) Trace作为一个很好的数据库追踪工具,在SQL Server 2005中便集成到系统功能中去,并且默认是开启的,当然我们也可以手动的关掉它,它位于sp_config配置参数中,我们可以通过以下语句查看: select * from sys.configurations where configuration_id = 1568

COM / OLE / ActiveX / IDispatch confusion

时光怂恿深爱的人放手 提交于 2019-12-03 03:23:50
I can't wrap my head around the differences among these terms. Are COM and ActiveX synonyms? Is ActiveX object just a COM object that exposes IDispatch? Lots of older MSDN pages mention IDispatch without any COM context. Does it have a separate history, and was just introduced under the COM 'umbrella' later in its lifecycle? Where does OLE fit in? Is its (considerable) presence in MFC naming and MSDN in general - all just legacy? Wikipedia gives some insight, but not much. I couldn't find a more in depth reference. Ofek Shilon Found some quotes from COM Programming by Example : Another thing

Cannot create an instance of OLE DB provider Microsoft.Jet.OLEDB.4.0 for linked server null

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to export from my Table data into Excel through T-SQL query. After little research I came up with this INSERT INTO OPENROWSET ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=G:\Test.xls;', 'SELECT * FROM [Sheet1$]') SELECT * FROM dbo.products When I execute the above query am getting this error Msg 7302, Level 16, State 1, Line 7 Cannot create an instance of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)". So went through internet for solution, got the below link https://blogs.msdn.microsoft.com/spike/2008/07

How to make Win32::OLE work on 64bit MS OFFICE installation

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have two PCs, one has MS Office 2013 32bit installed and another MS Office 64bit installed. I have Perl code that is using Win32::OLE Perl module to manipulate XLS spreadsheets. The code is working perfectly fine on 32bit PC, but has a problem on 64bit one. After doing some research here is what I found out. The problem is the following line of code: use Win32::OLE::Const 'Microsoft Excel .* Object Library'; I looked inside Win32::OLE::Const module and it seems that the module is looking for that library in the registry. When I printed out

SSIS: Cannot create an OLE DB accessor. Verify that the column metadata is valid

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have an SSIS package that in hes OLEDB destination have an NVARCHAR(MAX) field. This field is not even been filled by the data flow. The data flow task fails with error "Cannot create an OLE DB accessor. Verify that the column metadata is valid". I saw this similar question: How do I fix the multiple-step OLE DB operation errors in SSIS? and examined my metadata fallowing it's advice. I found that SSIS is mapping the offending column as NTEXT instead of DT_WSTR. I tried changing it's type to DT_WSTR with length 8000, but still

Does Microsoft OLE DB Provider for SQL Server support TLS 1.2

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Our client recently upgraded from TLS 1.0 to TLS 1.2 and after this our software cannot connect with SQL server. It uses OLE DB provider for connecting to SQL server. Below is the error which is returned from SQL server- [DBNETLIB][ConnectionOpen SECDoClientHandshake()]SSL Security error SQL State: 08001 SQL Error Number: 18 Could not find any useful information related to whether Microsoft OLE DB Provider for SQL Server support TLS 1.2 or not. One of the links I found seems to suggest that it is not supported. https://forums.iis.net/t

Embed files into Excel using Apache POI

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am exporting data to Excel file using Apache POI. In one weird requirement, I need to embed one file in the Excel using this POI. I have the file, and can be taken into streams or as byte arrays. After googling for much time, I am in a doubt whether POI really supports my requirement. Can we embed files into Excel? :-( Cheers, Anoop 回答1: Ok, this took very long to finally work out, as there were a few things which didn't look very important at the beginning, but actually corrupted the file when they haven't been set right - especially in

An OLE DB Provider was not specified in the ConnectionString. 'Provider=SQLOLEDB;

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i trying to run query using C#, i am getting the following problem An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB; my code string strConString = System.Configuration.ConfigurationManager.ConnectionStrings["WorkflowConnStr"].ConnectionString.ToString(); string sqlstr = "select * from table" OleDbConnection myConnection = new OleDbConnection(strConString); try {myConnection.Open();} catch (Exception err) { System.Diagnostics.Debug.WriteLine(err.Message); } OleDbCommand myCommand = new

How do I optimize Upsert (Update and Insert) operation within SSIS package?

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am not a DBA but I do work for a small company as the IT person. I have to replicate a database from staging to production. I have created an SSIS package to do this but it takes hours to run. This isn't a large data warehouse type of project, either, it's a pretty straightforward Upsert . I'm assuming that I am the weak link in how I designed it. Here's my procedure: Truncate staging tables ( EXECUTE SQL TASK ) Pull data from a development table into staging ( Data Flow Task ) Run a data flow task OLE DB Source Conditional Split