Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: Beginning Components for ASP


Message #1 by markc@w... on Thu, 20 Jul 2000 11:10:41
-----Original Message-----

From: Gunnar Hafsteinsson [mailto:guha@k...]

Sent: 19 July 1999 05:23

To: markc@w...

Subject: Help



Hi,

I am studying OLE DB from "Beginning Components for ASP" and I am trying 

to

write an function that queries the database and I took the function from

page 526 and I changed it to this:



STDMETHODIMP CDanceSchoolBrowser::FindInstructor(long lID)

{

CInstructors m_commandInstructors;

HRESULT hr;

hr = m_commandInstructors.Open();

if (FAILED(hr))

    return hr;



CCommand < CAccessor<_CNoParameters> > id;

CDBPropSet propset(DBPROPSET_ROWSET);



TCHAR szSQL[512];



_stprintf( szSQL, _T("SELECT * FROM Instructors WHERE [Instructor ID] 

%d"), lID);



hr = id.Open( m_commandInstructors.m_session,szSQL, &propset );

m_commandInstructors.Close();



return hr;

}



but the Open(...) function fails. Could you please tell me what I am doing

wrong. I would appreciate it if you would help me, 



thank you,



- gunnar



_______________________________________

Gunnar Hafsteinsson

mailto:guha@k...


  Return to Index