|
I have read article "Making ATL OLE DB Provider templates support updating of data" at www.codeproject.com. Through reading your article, you must be a professional in "OLE DB Provider" field, I think so. Now, would you like to give me some help about this issue? You will be pretty appreciated.
1. In the file "IRowsetChangImpl.h" of your "Simple Data Object with update support", there is a row of code "HRESULT hr = pT->GetDataHelper(hAccessor, pColInfo, (void**)&pBinding, pDstData, cCols, spConvert, pRow);"(lies in method "SetDataHelper"). But there is not definition and implementation of "GetDataHelper". How to resolve it?
2. Now, I'm building up a updatable OLE DB Provider. This provider will be run in MS SQLServer DTS. First "Transform Data Task" of MS SQLServer DTS get the rowset from SQLServer, then call this provider, and pass rowset data to my provider by calling IRowsetChange::SetData(HROW hRow, HACCESSOR hAccessor, void* pSrcData). My questions are as following:
1) "Transform Data Task" pass the new data(a row of data include 10 columns) to my provider through method "SetData(HROW hRow, HACCESSOR hAccessor, void* pSrcData)". Is it correct?
2) I have get the DBBINDING info by the next code:
STDMETHOD (SetData)(HROW hRow, HACCESSOR hAccessor, void* pSrcData)
{
DBACCESSORFLAGS *pdwAccessorFlags;
DBCOUNTITEM *pcBindings;
DBBINDING **prgBindings;
DBBINDING *pBindings;
pdwAccessorFlags = (DBACCESSORFLAGS *)::calloc(1, sizeof(DBACCESSORFLAGS));
pcBindings = (DBCOUNTITEM *)::calloc(1, sizeof(DBCOUNTITEM));
pBindings = (DBBINDING *)::calloc(1, sizeof(DBBINDING));
prgBindings = &pBindings;
HRESULT hr = this->GetBindings(hAccessor, pdwAccessorFlags, pcBindings, prgBindings);
return S_OK;
}
Now, how can I extract data from pSrcData? I'm puzzled.
Expect for your reply!
Thanks in advance!
|
|
|
|
|
Hello,
has anyone tried to use VC 6.0 with VC 8.0 compiler/linker/debuger?
Thanks,
Tomas Rapkauskas
|
|
|
|
|
Tomas Rapkauskas wrote: has anyone tried to use VC 6.0 with VC 8.0 compiler/linker/debuger?
Why you want to do that?
And i think it is not possible. There is a diffrent Project File and a diffrent language (MC++, CLI)
|
|
|
|
|
VC 8.0 IDE quite slow, uses more RAM and does not provide any features
which I need in current situation.
If it would be possible to use 8.0 compiler/debuger/linker with VC 6.0 IDE
I would avoid to buy new VC 8.0 IDE.
Also I don't think that it's dependencies between project workspace
and compiler.
I have tried "code blocks" with MSVC++ compiler it works, so I think it's possible to force VC 6.0 IDE to use VC 8.0 compiler.
|
|
|
|
|
Is it possible to use a different compiler than the compiler provided with VC IDE, but I forgot how to do this. Anyway you can found something on the web.
|
|
|
|
|
read the intructions of :|Visual C++ Toolkit 2003
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
The GetPrivateProfileSection Function returns values from a file with more than one null character, but with two null characters at the end. I am not able to use it because after the first null character, nothing is getting retrieved into some string object where i copy. How to use this function and get the WHOLE thing?
Thanks in advance
Aljechin Alexander
If space and time are related in some way, at what time and which dimension of the space did this relation occur? If the universe was created at some point of time, then does the time starts right from that point? Before that there was no time?
|
|
|
|
|
You need to use UNICODE supported apis to access the data.
If you dumpthe section of the code here , we might point out the exact problem that you are doing.
-Prakash
-- modified at 1:32 Wednesday 4th January, 2006
|
|
|
|
|
Sure, Here's the code.
//The .ini file
[SETTINGS]
Count = 10
ColorsEnabled = Red, Cyan
StackStyle = FALSE
Membership = Advanced
//In the C++ file
CString szValue;<br />
char chpValue[32767];<br />
<br />
GetPrivateProfileSection("SETTINGS",chpValue,sizeof(chpValue),"MySettings.ini");<br />
szValue = chpValue;<br />
The result is I get szValue to be "Count = 10" and nothing more! I need all the lines in the ini file in the "SETTINGS" section.
Thanks in advance
|
|
|
|
|
Aljechin wrote: szValue = chpValue;
Is not the right thing to do,
The CString copies only the first string till first zero is encontered,
You need to run a while loop(for example) to extract each key,value pair and assign it to appropriate variables.
-Prakash
|
|
|
|
|
Can you show a small code snippet?
Thanks
|
|
|
|
|
Heartfelt Thanks sir, the problem is solved.
Aljechin Alexander.
|
|
|
|
|
There are other ways to do this, but this is one way. Use this func:
<br />
CString getNextItem(char * wholeThing)<br />
{<br />
CString ret;<br />
static char * current;<br />
<br />
if(wholeThing) {<br />
current = wholeThing;<br />
}<br />
<br />
if(*current == '\0') ret = "";
else {<br />
ret = current;<br />
while(*current++);<br />
}<br />
return ret;<br />
}<br />
like this:
<br />
CString szValue;<br />
char chpValue[32767];<br />
<br />
GetPrivateProfileSection("SETTINGS",chpValue,sizeof(chpValue),"MySettings.ini");<br />
<br />
szValue = getNextItem(chpValue);<br />
<br />
while(szValue.GetLength()) {<br />
szValue = getNextItem(NULL);<br />
};<br />
|
|
|
|
|
Heart felt thanks, sir.
One more thing: Your's is just that damn good logic.
I must accept I have almost completely screwed up my basic c++ programming logic by staying with and relying heavily on the luxuries of MFC. I need to brush those stuff up back.
Aljechin Alexander
If space and time are related in some way, at what time and which dimension of the space did this relation occur? If the universe was created at some point of time, then does the time starts right from that point? Before that there was no time?
|
|
|
|
|
Thanks! It's mainly good old C. But it's still useful.
Kakan
|
|
|
|
|
It is not actually a best of doing it, it works but better way is possible.
I think you can actually optimise it.
-Prakash
-- modified at 2:26 Wednesday 4th January, 2006
|
|
|
|
|
Such as...?
As I said: "It's one way of doing it".
Of course, I know there are limitations, such as lack of Unicode support, no ATL, etc. etc.
But at least a gave the guy a solution to his problem. I haven't find another solution here, just a bunch of questions and vague suggestions how to solve the problem in question.
Anyone, feel totally free to give the guy a complete solution.
|
|
|
|
|
kakan wrote: I haven't find another solution here, just a bunch of questions and vague suggestions how to solve the problem in question.
True. Kakan actually gave me a solution that worked. I think i cannot expect him to give me the best optimised code at the begining itself, that too immediately.
Thanks to all
Aljechin Alexander
|
|
|
|
|
IMO, that's what this site is all about. Helping people, since noone has all the answers.
|
|
|
|
|
Aljechin wrote: True. Kakan actually gave me a solution that worked. I think i cannot expect him to give me the best optimised code at the begining itself, that too immediately.
Well I assumed you knew how to tokanise a zero seperated strings, quite basic thing to do.
-Prakash
|
|
|
|
|
I didnt say the solution is bad, All i wanted to point out that if you want to use the code for production code, then you have to optimise that code before using it.
-Prakash
|
|
|
|
|
Dude, can you optimise it?
|
|
|
|
|
Aljechin wrote: Dude, can you optimise it?
|
|
|
|
|
I can well optimise it, dont have the time.
Since you are asking for me to optimise it , i can understand that you dont want to spend too much effort on ur work.
-Prakash
-- modified at 3:39 Wednesday 4th January, 2006
|
|
|
|
|
I have optimised and modified the code to suit my need. I never meant to say that you don't know it, but I was trying to tell you gave me some idea, but Kakan gave me the same with a proper sample.
Many thanks for your time.
Aljechin
|
|
|
|