Visual C++.Net: A primer for C++ developers.
Great 'show by example' book.
In the last chapter developing the stock quotations web service none of the SQL insert statements seem to execute correctly.
Anyone else have this problem?
Clip from sample code that fails below.
[ soap_method ]
HRESULT AddMemberInfo(BSTR strUserID, BSTR strPassword, BSTR UserName, BSTR* strResult)
{
CDataSource ds;
CCommand<CAccessor<CLogin> > cmd;
CSession session;
HRESULT hr=ds.OpenFromInitializationString(L"Provider=Micr osoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\\StockDB.mdb");
if(SUCCEEDED(hr))
{
if(SUCCEEDED(session.Open(ds)))
{
CString userID(strUserID);
CString password(strPassword);
CString userName(UserName);
CString insertQuery("INSERT INTO Login VALUES('");
insertQuery +=userID;
insertQuery +="','";
insertQuery += userName;
insertQuery += "','";
insertQuery += password;
insertQuery += "')";
// this call always fails ...
hr= cmd.Open(session, insertQuery);
TIA,
Andy Bache
|