Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Use Enter key in Edit box Pin
GDavy23-May-05 3:06
GDavy23-May-05 3:06 
GeneralSearchPath API fails in UNICODE debug build Pin
Vinaya23-May-05 1:00
Vinaya23-May-05 1:00 
GeneralRe: SearchPath API fails in UNICODE debug build Pin
Ryan Binns23-May-05 4:19
Ryan Binns23-May-05 4:19 
GeneralRe: SearchPath API fails in UNICODE debug build Pin
RChin23-May-05 4:24
RChin23-May-05 4:24 
GeneralRe: SearchPath API fails in UNICODE debug build Pin
Vinaya23-May-05 18:27
Vinaya23-May-05 18:27 
GeneralCapture handle of window from process id Pin
saravananvv23-May-05 0:45
saravananvv23-May-05 0:45 
GeneralRe: Capture handle of window from process id Pin
Flit24-May-05 3:08
Flit24-May-05 3:08 
GeneralRecord Set failed to open Pin
mikobi23-May-05 0:42
mikobi23-May-05 0:42 
Im using Visual c++ 6.0 with sql server 2000 database.

I create a new project with file database option and i select one of my big table.

Without writing another code when execute i have this error "Record set failed to open"
I don't understand, this is my code that was create automatically:

// articletestSet.h : interface of the CArticletestSet class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_ARTICLETESTSET_H__F9F350D0_CB82_11D9_B5A3_0001022AAD75__INCLUDED_)
#define AFX_ARTICLETESTSET_H__F9F350D0_CB82_11D9_B5A3_0001022AAD75__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CARTICLE
{
public:
CARTICLE()
{
memset( (void*)this, 0, sizeof(*this) );
};

wchar_t m_CODMAG[6];
wchar_t m_CODART[6];
wchar_t m_LIBELLE[26];
wchar_t m_libeltech[26];
wchar_t m_groupe[6];
wchar_t m_UNITE[3];
float m_QUANTITE;
float m_SEUILmag;
float m_PRIX_VENTE;
float m_PRIX_DOLLAR;
float m_prix_unitaire_dollar;
float m_pa_fc;
float m_LMH;
float m_LMB;
float m_encours;
wchar_t m_code_loca[6];
wchar_t m_shelf[16];
float m_aprix_unitaire_dollar;
wchar_t m_compte_charge[6];
ISequentialStream* m_image;
wchar_t m_code_arturi[6];
wchar_t m_NAME3[26];
wchar_t m_code_pe1[6];
wchar_t m_NAME4[26];
wchar_t m_code_pe2[6];
wchar_t m_name5[26];
wchar_t m_priorite[1];
wchar_t m_service[6];
wchar_t m_fournisseur[6];
wchar_t m_group2[6];
wchar_t m_group3[6];
wchar_t m_group4[6];
wchar_t m_deviseach[3];
wchar_t m_second_name[26];
wchar_t m_categorie[11];
wchar_t m_libcategorie[26];


BEGIN_COLUMN_MAP(CARTICLE)
COLUMN_ENTRY_TYPE(1, DBTYPE_WSTR, m_CODMAG)
COLUMN_ENTRY_TYPE(2, DBTYPE_WSTR, m_CODART)
COLUMN_ENTRY_TYPE(3, DBTYPE_WSTR, m_LIBELLE)
COLUMN_ENTRY_TYPE(4, DBTYPE_WSTR, m_libeltech)
COLUMN_ENTRY_TYPE(5, DBTYPE_WSTR, m_groupe)
COLUMN_ENTRY_TYPE(6, DBTYPE_WSTR, m_UNITE)
COLUMN_ENTRY_TYPE(7, DBTYPE_R4, m_QUANTITE)
COLUMN_ENTRY_TYPE(8, DBTYPE_R4, m_SEUILmag)
COLUMN_ENTRY_TYPE(9, DBTYPE_R4, m_PRIX_VENTE)
COLUMN_ENTRY_TYPE(10, DBTYPE_R4, m_PRIX_DOLLAR)
COLUMN_ENTRY_TYPE(11, DBTYPE_R4, m_prix_unitaire_dollar)
COLUMN_ENTRY_TYPE(12, DBTYPE_R4, m_pa_fc)
COLUMN_ENTRY_TYPE(13, DBTYPE_R4, m_LMH)
COLUMN_ENTRY_TYPE(14, DBTYPE_R4, m_LMB)
COLUMN_ENTRY_TYPE(15, DBTYPE_R4, m_encours)
COLUMN_ENTRY_TYPE(16, DBTYPE_WSTR, m_code_loca)
COLUMN_ENTRY_TYPE(17, DBTYPE_WSTR, m_shelf)
COLUMN_ENTRY_TYPE(18, DBTYPE_R4, m_aprix_unitaire_dollar)
COLUMN_ENTRY_TYPE(19, DBTYPE_WSTR, m_compte_charge)
BLOB_ENTRY(20, IID_ISequentialStream, STGM_READ, m_image)
COLUMN_ENTRY_TYPE(21, DBTYPE_WSTR, m_code_arturi)
COLUMN_ENTRY_TYPE(22, DBTYPE_WSTR, m_NAME3)
COLUMN_ENTRY_TYPE(23, DBTYPE_WSTR, m_code_pe1)
COLUMN_ENTRY_TYPE(24, DBTYPE_WSTR, m_NAME4)
COLUMN_ENTRY_TYPE(25, DBTYPE_WSTR, m_code_pe2)
COLUMN_ENTRY_TYPE(26, DBTYPE_WSTR, m_name5)
COLUMN_ENTRY_TYPE(27, DBTYPE_WSTR, m_priorite)
COLUMN_ENTRY_TYPE(28, DBTYPE_WSTR, m_service)
COLUMN_ENTRY_TYPE(29, DBTYPE_WSTR, m_fournisseur)
COLUMN_ENTRY_TYPE(30, DBTYPE_WSTR, m_group2)
COLUMN_ENTRY_TYPE(31, DBTYPE_WSTR, m_group3)
COLUMN_ENTRY_TYPE(32, DBTYPE_WSTR, m_group4)
COLUMN_ENTRY_TYPE(33, DBTYPE_WSTR, m_deviseach)
COLUMN_ENTRY_TYPE(34, DBTYPE_WSTR, m_second_name)
COLUMN_ENTRY_TYPE(35, DBTYPE_WSTR, m_categorie)
COLUMN_ENTRY_TYPE(36, DBTYPE_WSTR, m_libcategorie)
END_COLUMN_MAP()

};

class CArticletestSet : public CCommand<caccessor<carticle> >
{
public:

HRESULT Open()
{
CDataSource db;
CSession session;
HRESULT hr;

CDBPropSet dbinit(DBPROPSET_DBINIT);
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, "yhwha");
dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);
dbinit.AddProperty(DBPROP_AUTH_USERID, "sa");
dbinit.AddProperty(DBPROP_INIT_CATALOG, "gesmed");
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, "sem1");
dbinit.AddProperty(DBPROP_INIT_LCID, (long)1036);
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);

hr = db.OpenWithServiceComponents("SQLOLEDB.1", &dbinit);
if (FAILED(hr))
return hr;

hr = session.Open(db);
if (FAILED(hr))
return hr;

CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_CANFETCHBACKWARDS, true);
propset.AddProperty(DBPROP_IRowsetScroll, true);
propset.AddProperty(DBPROP_IRowsetChange, true);
propset.AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE );

hr = CCommand<caccessor<carticle> >::Open(session, "SELECT * FROM dbo.ARTICLE", &propset);
if (FAILED(hr))
return hr;

return MoveNext();
}

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ARTICLETESTSET_H__F9F350D0_CB82_11D9_B5A3_0001022AAD75__INCLUDED_)



I learn my self
GeneralRe: Record Set failed to open Pin
David Crow23-May-05 2:18
David Crow23-May-05 2:18 
GeneralNo effect after calling SetButtonInfo in a CFormView Pin
AnTri23-May-05 0:41
AnTri23-May-05 0:41 
GeneralRe: No effect after calling SetButtonInfo in a CFormView Pin
Ryan Binns23-May-05 4:21
Ryan Binns23-May-05 4:21 
GeneralHTTP Parser, method HEAD Pin
Anonymous23-May-05 0:33
Anonymous23-May-05 0:33 
GeneralConverting from CComBSTR to std::string Pin
Franz Klein22-May-05 23:55
Franz Klein22-May-05 23:55 
GeneralRe: Converting from CComBSTR to std::string Pin
RChin23-May-05 0:14
RChin23-May-05 0:14 
GeneralPreventing a window frm closing Pin
softwaremonkey22-May-05 23:40
softwaremonkey22-May-05 23:40 
GeneralRe: Preventing a window frm closing Pin
toxcct22-May-05 23:43
toxcct22-May-05 23:43 
GeneralRe: Preventing a window frm closing Pin
softwaremonkey22-May-05 23:46
softwaremonkey22-May-05 23:46 
GeneralRe: Preventing a window frm closing Pin
toxcct22-May-05 23:53
toxcct22-May-05 23:53 
GeneralRe: Preventing a window frm closing Pin
ddmcr23-May-05 1:45
ddmcr23-May-05 1:45 
GeneralIs it logical to resize image for every rotation Pin
bratgiles22-May-05 23:15
bratgiles22-May-05 23:15 
GeneralMinimum configuration Pin
Kiki9922-May-05 22:35
Kiki9922-May-05 22:35 
GeneralRe: Minimum configuration Pin
Geert van Horrik22-May-05 23:24
Geert van Horrik22-May-05 23:24 
GeneralCreating a tlb-file Pin
anderslundsgard22-May-05 20:27
anderslundsgard22-May-05 20:27 
GeneralRe: Creating a tlb-file Pin
toxcct22-May-05 20:28
toxcct22-May-05 20:28 
GeneralRe: Creating a tlb-file Pin
ThatsAlok22-May-05 20:38
ThatsAlok22-May-05 20:38 

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.