ole

Getting a char* from a _variant_t in optimal time

a 夏天 提交于 2020-01-24 06:26:09
问题 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,

How to catch a moment when the external editor of TOLEContainer has been closed?

你。 提交于 2020-01-22 02:03:52
问题 Borland Developer Studio 2006, Delphi: I have a TOLEContainer object with AllowInPlace=False. When the external editor is closed and changed my OLE object I have to do something with this OLE object inside TOLeContainer. The problem is I can't catch a moment when the external editor is closed. OnDeactivate event is not working. Probably I should change the source code of TOLEContainer adding this event myself, but I don't know where is the best place for it. Can you advice some method? 回答1: A

How to catch a moment when the external editor of TOLEContainer has been closed?

时间秒杀一切 提交于 2020-01-22 02:03:21
问题 Borland Developer Studio 2006, Delphi: I have a TOLEContainer object with AllowInPlace=False. When the external editor is closed and changed my OLE object I have to do something with this OLE object inside TOLeContainer. The problem is I can't catch a moment when the external editor is closed. OnDeactivate event is not working. Probably I should change the source code of TOLEContainer adding this event myself, but I don't know where is the best place for it. Can you advice some method? 回答1: A

Microsoft OLE DB Provider for SQL Server (0x80004005)

余生长醉 提交于 2020-01-19 07:59:29
在弄有关Sharepoint的程序时有时会碰到这种情况,真上人摸不清原因(对sharepoint不懂 ),今天终于找到了这个,解决了,转自: http://tsinghualove.blog.hexun.com/21796806_d.html , thanks! Microsoft OLE DB Provider for SQL Server (0x80004005) [DBNETLIB][ConnectionOpen (PreLoginHandshake()).]一般性网络错误。请检查网络文档。 笔者ASP运行环境:操作系统为Windows XP SP2,IIS的版本为默认的5.1,数据库为SQL Server 2005(MDAC版本为2.8) 一、出现“Microsoft OLE DB Provider for SQL Server (0x80004005)[DBNETLIB][ConnectionOpen (PreLoginHandshake()).]一般性网络错误。请检查网络文档。”错误 在学习ASP过程中,笔者的数据库连接函数中,连接源Data Source一直设置的是机器名,在 后来将连接源Data Source改为本机IP地址127.0.0.1 就出现了“Microsoft OLE DB Provider for SQL Server (0x80004005)

Microsoft OLE DB Provider for ODBC Drivers 错误 \'80004005\'

风格不统一 提交于 2020-01-18 09:17:40
Microsoft VBScript 编译器错误 错误 '80004005' 缺少 'End' /iisHelp/common/500-100.asp,行242 开始还以为真的是/iisHelp/common/500-100.asp,但后来才发现是连接字符串的问题,晕死以前还害得我重新装了2003~~~ Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005' MicrosoftODBC Microsoft Access Driver常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0x704 Thread 0x830 DBC 0x9073fdc Jet'。 /qiaok/tongxuelu/class/ClassPhotoList.asp,行258 这是因为Windows2000 SP2以后的新bug造成的。也许微软不喜欢ODBC了,所以出此下策。正确的方法是使用OLEDB来连接Access。连接字符串为:"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&数据库文件名 搞定! 来源: https://www.cnblogs.com/kary/archive/2004/08/17/34004.html

Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'

删除回忆录丶 提交于 2020-01-16 18:24:39
最近在部署asp网站到客户服务器上的时候发生了两个错误,如下: Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005' [Microsoft][ODBC Microsoft Access Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0x174 Thread 0xa28 DBC 0x7ef2024 Jet'。 Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005' [Microsoft][ODBC Microsoft Access Driver] Microsoft Jet 数据库引擎打不开文件'(未知的)'。 它已经被别的用户以独占方式打开,或没有查看数据的权限。 老样子先google再百度,搜了一大堆解决方法,这里转个比较靠谱的吧。 方法1: 错误类型: Microsoft OLE DB Provider for ODBC Drivers (’0×80004005′) [Microsoft][ODBC Microsoft Access Driver] Microsoft Jet 数据库引擎打不开文件’(未知的)’。 它已经被别的用户以独占方式打开,或没有查看数据的权限。 /conn

使用Microsoft OLE DB Provider For Oracle链接Oracle

半腔热情 提交于 2020-01-15 06:43:46
1.打开SQL2005,右击服务器对象,选择新建,然后点链接服务器. 2.填上你所要设置的链接服务器名称,在访问接口中选择“Microsoft OLE DB Provider for Oracle”,产品名称随便取,数据源是你在本地配置服务时给它的服务名. 还要在安全性里选择使用此安全上下文建立连接,然后输入用户名密码,就OK了 3.点击确定就建立好了... 4.OPENQUERY知识点: 权限 : 任何用户都可以执行 OPENQUERY。用于连接到远程服务器的权限是从为链接服务器定义的设置中获取的。 例如:SELECT * FROM OPENQUERY(ABC,'select * from table'); 关于链接数据库中的存储过程sp_addlinkedserver,应该是系统里直接就有的吧,因为它在系统存储过程中.你可以执行一下:exec sp_addlinkedserver XXX,XXX,... 来源: https://www.cnblogs.com/piaoxueyuan/archive/2012/02/08/2342457.html

Retrieving Outlook 'Inbox' and 'Sent' folders in Delphi using OLE

别来无恙 提交于 2020-01-13 16:45:09
问题 What's the best way to go about extracting Outlook folders from within Delphi? Ideally I'd like to retrieve the Inbox folder and any other folders within it. I don't require the email headers/message just purely the folder names. Delphi BDS 2006 回答1: See here for Outlook's Object Model. Below displays the names of folders in the Inbox: procedure TForm1.Button1Click(Sender: TObject); var Outlook, oNameSpace, Inbox: OleVariant; i: Integer; begin try Outlook := GetActiveOleObject('Outlook

How to extract the contents of an OLE container?

佐手、 提交于 2020-01-13 10:45:12
问题 I need to break open a MS Word file (.doc) and extract its constituent files ('[1]CompObj', 'WordDocument' etc). Something like 7-zip can be used to do this manually but I need to do this programatically. I've gathered that a Word document is an OLE container (hence why 7-zip can be used to view its contents) but I can't work out how to (using C++): open the OLE container extract each constituent file and save it to disk I've found a couple of examples of OLE automation (eg here) but what I

How to extract the contents of an OLE container?

蹲街弑〆低调 提交于 2020-01-13 10:43:27
问题 I need to break open a MS Word file (.doc) and extract its constituent files ('[1]CompObj', 'WordDocument' etc). Something like 7-zip can be used to do this manually but I need to do this programatically. I've gathered that a Word document is an OLE container (hence why 7-zip can be used to view its contents) but I can't work out how to (using C++): open the OLE container extract each constituent file and save it to disk I've found a couple of examples of OLE automation (eg here) but what I