adodb.stream work problem list in C++

it is easy to using adodb.stream, but it will bring some problem in C++, here list some problem attentioned:

1. Must use Ado v2.7

#import "c:/Program Files/Common Files/System/ADO/msado27.tlb" /
    no_namespace rename("EOF", "EndOfFile")

2.  Must Open before Write or WriteText

3. assign correctly parameters: 

[pStreamTest->Open(vtMissing,adModeUnknown,adOpenStreamUnspecified,"","");]

vtMissing: That's a variant of type VT_ERROR and scode of DISP_E_PARAMNOTFOUND 

Here is define in IDL file:

HRESULT Open(
                [in, optional] VARIANT Source,
                [in, optional, defaultvalue(0)] ConnectModeEnum Mode,
                [in, optional, defaultvalue(-1)] StreamOpenOptionsEnum
Options,
                [in, optional, defaultvalue("")] BSTR UserName,
                [in, optional, defaultvalue("")] BSTR Password);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章