Click here to Skip to main content
16,005,552 members
Home / Discussions / Database
   

Database

 
GeneralRe: ADO & OLEDB, Which runs faster with VC? Pin
Bret Faller9-Aug-01 13:48
Bret Faller9-Aug-01 13:48 
AnswerRe: ADO & OLEDB, Which runs faster with VC? Pin
Rashid Thadha9-Aug-01 6:41
Rashid Thadha9-Aug-01 6:41 
GeneralRe: ADO & OLEDB, Which runs faster with VC? Pin
Martin Bohring6-Sep-01 1:34
Martin Bohring6-Sep-01 1:34 
GeneralQuery Builder Component Pin
Kannan Kalyanaraman1-Aug-01 2:46
Kannan Kalyanaraman1-Aug-01 2:46 
QuestionSQL ?? Pin
otvac1-Aug-01 1:16
otvac1-Aug-01 1:16 
AnswerRe: SQL ?? Pin
Anders Molin2-Aug-01 7:33
professionalAnders Molin2-Aug-01 7:33 
GeneralFlexible Scheme Evolution in Relational Database Model Pin
kushibhai26-Jul-01 22:53
kushibhai26-Jul-01 22:53 
GeneralIRowsetChange::SetData() Pin
Bret Faller26-Jul-01 8:14
Bret Faller26-Jul-01 8:14 
Hello,

I'm trying to write an OLE DB Wrapper class and have created a function called SetStringFieldValue and inside that function I need to set 1 columns data to the string passed to the function. I have yet to find any examples of SetData anywhere and for some reason its not working for me. Any help is greatly appreciated.

[PRE]
void COleDBWrapper::SetStringFieldValue(int nIndex, LPCTSTR lpszValue)
{
CString strValue(lpszValue);
IRowsetChange* pIRowsetChange = (IRowsetChange*)m_pUnkRowsetChange;
IRowsetUpdate* pIRowsetUpdate = (IRowsetUpdate*)m_pUnkRowsetUpdate;
IAccessor* pIAccessor = NULL;
HACCESSOR hAccessor;
ULONG cBindings = 1;
DBBINDING rgBinding[1];
memset(rgBinding, 0, sizeof(DBBINDING));

char szValue[50];
_tcscpy(szValue, strValue.GetBuffer(0));

rgBinding[0].iOrdinal = nIndex;
rgBinding[0].dwPart = DBPART_VALUE|DBPART_STATUS|DBPART_LENGTH;
rgBinding[0].obLength = (strValue.GetLength() + 1) * sizeof(TCHAR);
rgBinding[0].obStatus = (strValue.GetLength() + 1) * sizeof(TCHAR);
(CString)rgBinding[0].obValue = szValue; // -- DOESN'T DO JACK! -- //
rgBinding[0].wType = DBTYPE_STR;
rgBinding[0].pTypeInfo = NULL;
rgBinding[0].pObject = NULL;
rgBinding[0].pBindExt = NULL;
rgBinding[0].dwMemOwner = DBMEMOWNER_CLIENTOWNED;
rgBinding[0].cbMaxLen = (strValue.GetLength() + 1) * sizeof(TCHAR);
rgBinding[0].dwFlags = 0;

HRESULT hr = m_pUnkRowset->QueryInterface(IID_IAccessor, (void**)&pIAccessor);
if (FAILED(hr))
return;

hr = pIAccessor->CreateAccessor(DBACCESSOR_ROWDATA, 1, rgBinding, 0,
&hAccessor, NULL);
if (FAILED(hr))
return;

hr = pIRowsetChange->SetData(m_hRow, hAccessor, szValue);
// hr is ALWAYS DB_E_ERRORSOCCURRED
}
[/PRE]


Bret Faller
Odyssey Computing, Inc.
QuestionHow to read parameter from stored procedure ? Pin
Bartek26-Jul-01 2:45
Bartek26-Jul-01 2:45 
AnswerRe: How to read parameter from stored procedure ? Pin
Rashid Thadha9-Aug-01 6:48
Rashid Thadha9-Aug-01 6:48 
GeneralCreating a user in Oracle Pin
Dhanush26-Jul-01 0:16
professionalDhanush26-Jul-01 0:16 
GeneralExporting data from Excel Pin
v_krishnan25-Jul-01 19:31
v_krishnan25-Jul-01 19:31 
GeneralNeed to send a string to running application - please help Pin
20-Jul-01 13:48
suss20-Jul-01 13:48 
QuestionFind in ADO, how does it works? Pin
Gérald Mercet19-Jul-01 22:48
Gérald Mercet19-Jul-01 22:48 
AnswerRe: Find in ADO, how does it works? Pin
Carlos Antollini20-Jul-01 5:33
Carlos Antollini20-Jul-01 5:33 
GeneralSQL Server Stored Procedure Encryption Pin
19-Jul-01 18:24
suss19-Jul-01 18:24 
GeneralADO error adErrItemNotFound Pin
David Douglass17-Jul-01 5:39
David Douglass17-Jul-01 5:39 
QuestionHow To Set OBDC In Installshield? Pin
nemati17-Jul-01 1:24
nemati17-Jul-01 1:24 
GeneralRecommend a Report tool for c++ Pin
Rod Hamilton16-Jul-01 11:51
Rod Hamilton16-Jul-01 11:51 
GeneralSQLXML. Type Library Pin
Özgür12-Jul-01 22:27
Özgür12-Jul-01 22:27 
GeneralHelp!! ADO and NT Pin
Ralf Friedrich Hain12-Jul-01 6:35
Ralf Friedrich Hain12-Jul-01 6:35 
GeneralRe: Help!! ADO and NT Pin
Sardaukar12-Jul-01 6:45
Sardaukar12-Jul-01 6:45 
GeneralRe: Help!! ADO and NT Pin
Ralf Friedrich Hain12-Jul-01 7:13
Ralf Friedrich Hain12-Jul-01 7:13 
GeneralRe: Help!! : I've solved my problem ... Pin
Ralf Friedrich Hain17-Jul-01 2:03
Ralf Friedrich Hain17-Jul-01 2:03 
Generalretrieving XML Pin
Özgür11-Jul-01 23:20
Özgür11-Jul-01 23:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.