ole

Linked Server 1:链接服务器

倖福魔咒の 提交于 2020-03-04 13:36:44
链接服务器(Linked Server)允许访问针对OLE DB数据源的分布式异构查询, 通过使用sys.sp_addlinkedserver创建链接服务器后,可以对此服务器运行分布式查询。 如果链接服务器被定义为SQL Server实例,则可以执行远程存储过程。 一,链接服务器 使用 sys.sp_addlinkedserver 添加链接服务器,除了必须在本地自定义一个链接服务器的别名(Alias)之外,还必须指定链接服务器的产品名称(Product Name)、提供程序名称(Provider Name)、数据源(Data Source)、提供程序字符串( Provider String)等参数,添加成功之后,系统自动创建一个默认登陆映射,用于访问链接服务器。 sp_addlinkedserver [ @server= ] 'server' [ , [ @srvproduct= ] 'product_name' ] [ , [ @provider= ] 'provider_name' ] [ , [ @datasrc= ] 'data_source' ] [ , [ @location= ] 'location' ] [ , [ @provstr= ] 'provider_string' ] [ , [ @catalog= ] 'catalog' ] 参数解释: @server=

用 Perl 读写 Excel 文件

妖精的绣舞 提交于 2020-03-02 06:39:25
安装 Excel 模块的 PPM 命令 ppm> install OLE::Storage_Lite ppm> install Spreadsheet::ParseExcel ppm> install Spreadsheet::WriteExcel Windows 示例:解析 读写已有Excel #!/usr/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # die on errors... # get already active Excel application or open new my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); # open Excel file my $Book = $Excel->Workbooks->Open("c:/komodo projects/test.xls"); # You can dynamically obtain the number of worksheets, rows,

Integration Services创建ETL包

隐身守侯 提交于 2020-02-14 00:00:23
http://www.cnblogs.com/chiniao/archive/2009/12/23/1630595.html (转载) Microsoft Integration Services 是一个可以生成高性能数据集成解决方案(包括为数据仓库提取、转换和加载 (ETL) 包)的平台。 Integration Services 包括用于生成和调式包的图形工具和向导;用于执行工作流函数(如 FTP 操作)、执行 SQL 语句以及发送电子邮件的任务;用于提取和加载数据的数据源和目标;用于清除、聚合、合并和复制数据的转换;用于管理包执行和存储的管理服务,即 Integration Services;以及用于 Integration Services 对象模型编程的应用程序编程接口 (API)。 说明 : 本文是作者在学习Integration Services过程中的笔记,基本思路和内容都来自SQL Server 联机丛书。觉得园子里的BI方面的资源比较少,就放上来了。 学习本文需要建立在对Integration Services基本了解的基础。 如果没有任何了解,请参考一步一步学习BI(1)-认识Integration Services 本文中将用到的数据库为微软的 AdventureWorksDW 本文中将用到的文本数据在 这里 请先下载这两份数据文件,我们在接来实验中将要用到

[SQL SERVER] 跨服务器查询

半世苍凉 提交于 2020-02-12 05:36:57
来自: http://www.cnblogs.com/daniel206/archive/2008/01/16/1041748.html 方法一: 用OPENDATASOURCE 下面是个跨SQLServer查询的示例 Select TableA.*,TableB.* From OPENDATASOURCE( 'SQLOLEDB', 'Data Source=ServerA;User ID=UserID;Password=Password' ).databaseAName.dbo.TableA Left Join OPENDATASOURCE( 'SQLOLEDB', 'Data Source=ServerB;User ID=UserID;Password=Password' ).databaseBName.dbo.TableB On TableA.key=TableB.key 下面是个查询的示例,它通过用于 Jet 的 OLE DB 提供程序查询 Excel 电子表格。 SELECT * FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')..

[SQL SERVER] 跨服务器查询

巧了我就是萌 提交于 2020-02-12 05:01:29
[SQL SERVER] 跨服务器查询 方法一: 用OPENDATASOURCE 下面是个跨SQLServer查询的示例 Select TableA.*,TableB.* From OPENDATASOURCE( 'SQLOLEDB', 'Data Source=ServerA;User ID=UserID;Password=Password' ).databaseAName.dbo.TableA Left Join OPENDATASOURCE( 'SQLOLEDB', 'Data Source=ServerB;User ID=UserID;Password=Password' ).databaseBName.dbo.TableB On TableA.key=TableB.key 下面是个查询的示例,它通过用于 Jet 的 OLE DB 提供程序查询 Excel 电子表格。 SELECT * FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:/Finance/account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions 方法二(也可以在企业管理器里添加 linkServer): sp

[SQL SERVER] 跨服务器查询

时间秒杀一切 提交于 2020-02-12 03:49:29
方法一: 用OPENDATASOURCE 下面是个跨SQLServer查询的示例 Select TableA.*,TableB.* From OPENDATASOURCE( 'SQLOLEDB', 'Data Source=ServerA;User ID=UserID;Password=Password' ).databaseAName.dbo.TableA Left Join OPENDATASOURCE( 'SQLOLEDB', 'Data Source=ServerB;User ID=UserID;Password=Password' ).databaseBName.dbo.TableB On TableA.key=TableB.key 下面是个查询的示例,它通过用于 Jet 的 OLE DB 提供程序查询 Excel 电子表格。 SELECT * FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions 方法二(也可以在企业管理器里添加 linkServer): sp_addlinkedserver 创建一个链接的服务器

iWebBrowser::Navigate Deadlock after a ole32.dll exception

回眸只為那壹抹淺笑 提交于 2020-01-25 20:52:11
问题 I have a question related to windows embedded browser and COM. What I am trying to do is to display some data to the user in a HTML form so I use the iwebbrowser2 control to achieve this. I have this weird deadlock or hang in my application after a call to iwebbrowser2 Navigate is made after a ole32.dll crash. This ole32 crash randomly happens in my application. There is not a usual place or time in which the exception happens. It could happen right in the beginning on the application

OLE error code 80020101 caused by execute_script of waitr

北城余情 提交于 2020-01-24 23:05:15
问题 I just tried this: $browser.execute_script("alert(\"aaa\")") and then I get the error below: h:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/page-container.rb:46:in `method_missing': (in OLE method `execScript': ) (WIN32OLERuntimeError) OLE error code:80020101 in <Unknown> Could not complete the operation due to error 80020101.HRESULT error code:0x80020009 Exception occurred. from h:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/page

OLE error code 80020101 caused by execute_script of waitr

∥☆過路亽.° 提交于 2020-01-24 23:04:30
问题 I just tried this: $browser.execute_script("alert(\"aaa\")") and then I get the error below: h:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/page-container.rb:46:in `method_missing': (in OLE method `execScript': ) (WIN32OLERuntimeError) OLE error code:80020101 in <Unknown> Could not complete the operation due to error 80020101.HRESULT error code:0x80020009 Exception occurred. from h:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/page

Getting a char* from a _variant_t in optimal time

旧巷老猫 提交于 2020-01-24 06:27:27
问题 Here's the code I want to speed up. It's getting a value from an ADO recordset and converting it to a char*. But this is slow. Can I skip the creation of the _bstr_t? _variant_t var = pRs->Fields->GetItem(i)->GetValue(); if (V_VT(&var) == VT_BSTR) { char* p = (const char*) (_bstr_t) var; 回答1: The first 4 bytes of the BSTR contain the length. You can loop through and get every other character if unicode or every character if multibyte. Some sort of memcpy or other method would work too. IIRC,