Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Munkijo

@Munkijo
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Opening a CRecordset derived class problem
    M Munkijo

    I am currently working on a system that uses an Access database to store a list of url's waiting to be processed. I need to be able to add to, and amend the database, and so, I have derived a class from the CRecordset class called CURLRecordset using the classwizard. In my application, I can succesfully open a CDatabase object in order to connect to the database, but when it comes to opening the actual recordsets associated with it: /* CURLRecordset* unparsed_urls; CDatabase* db; CString sql; */ unparsed_urls = new ( CUnparsed ) ( db ); sql.Format ( "SELECT * FROM urls WHERE status = %d;", STATUS_NOT_CRAWLED ); unparsed_urls->Open ( CRecordset::snapshot, (LPCTSTR)sql ); I get the following exception: "Invalid character value for cast specification on column number 2 (urladdress)" I have traced the source of the exception to the final move() function call in the CRecordset class's Open() method, but I have no idea how to deal with it. My database schema is as follows: TABLE urls = ( long urlid (PRIMARY KEY) VARCHAR(256) urladdress long status long level long keywordid long sourceid ) The header file for the CURLRecordset class is as follows: class CURLRecordset : public CRecordset { public: CURLRecordset(CDatabase* pDatabase = NULL); DECLARE_DYNAMIC(CURLRecordset) // Field/Param Data //{{AFX_FIELD(CURLRecordset, CRecordset) long m_keywordid; long m_level; long m_sourceid; long m_status; CString m_urladdress; long m_urlid; //}}AFX_FIELD // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CURLRecordset) public: virtual CString GetDefaultConnect(); // Default connection string virtual CString GetDefaultSQL(); // Default SQL for Recordset virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support //}}AFX_VIRTUAL // Implementation #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif }; Any help will be greatly appreciated!

    C / C++ / MFC database help xml tutorial

  • Help needed deriving class from CRecordset
    M Munkijo

    I am currently working on a system that uses an Access database to store a list of url's waiting to be processed. I need to be able to add to, and amend the database, and so, I have derived a class from the CRecordset class called CURLRecordset using the classwizard. In my application, I can succesfully open a CDatabase object in order to connect to the database, but when it comes to opening the actual recordsets associated with it: /* CURLRecordset* unparsed_urls; CDatabase* db; CString sql; */ unparsed_urls = new ( CUnparsed ) ( db ); sql.Format ( "SELECT * FROM urls WHERE status = %d;", STATUS_NOT_CRAWLED ); unparsed_urls->Open ( CRecordset::snapshot, (LPCTSTR)sql ); I get the following exception: "Invalid character value for cast specification on column number 2 (urladdress)" I have traced the source of the exception to the final move() function call in the CRecordset class, but I have no idea how to deal with it. My database schema is as follows: TABLE urls = ( long urlid (PRIMARY KEY) VARCHAR(256) urladdress long status long level long keywordid long sourceid ) The header file for the CURLRecordset class is as follows: class CURLRecordset : public CRecordset { public: CURLRecordset(CDatabase* pDatabase = NULL); DECLARE_DYNAMIC(CURLRecordset) // Field/Param Data //{{AFX_FIELD(CURLRecordset, CRecordset) long m_keywordid; long m_level; long m_sourceid; long m_status; CString m_urladdress; long m_urlid; //}}AFX_FIELD // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CURLRecordset) public: virtual CString GetDefaultConnect(); // Default connection string virtual CString GetDefaultSQL(); // Default SQL for Recordset virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support //}}AFX_VIRTUAL // Implementation #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif }; Any help will be greatly appreciated!

    Database database xml help tutorial

  • Problem with CString::Replace ( LPCTSTR lpszOld, LPCTSTR lpszNew );
    M Munkijo

    What??? No, where it says HTMLfile->Replace (" ", " "); the first string is actually a non-braking space character - In the while loop, it's meant to have two spaces between the first seyt of inverted commas, and one in the second set.

    C / C++ / MFC help html question

  • Problem with CString::Replace ( LPCTSTR lpszOld, LPCTSTR lpszNew );
    M Munkijo

    It's not a very elegant method, but the code is: void CParser::StandardiseHTML ( CString* HTMLfile ) { HTMLfile->Replace ("@", "@"); HTMLfile->Replace ('\n', ' '); HTMLfile->Replace ('\t', ' '); HTMLfile->Replace (" ", " "); while ( HTMLfile->Replace (" ", " ") != 0 ); HTMLfile->Replace (" =", "="); HTMLfile->Replace ("= ", "="); HTMLfile->MakeUpper (); } It manages to get into trouble with the statement HTMLfile->Replace (" ", " ");

    C / C++ / MFC help html question

  • Problem with CString::Replace ( LPCTSTR lpszOld, LPCTSTR lpszNew );
    M Munkijo

    I have a CString type variable with a large HTML file in it. When I attempt to replace all occurrances of a character with another characer, it works fine, however, if I attempt to replace a string ("= ") with another string ("="), it appears to get stuck in some endless loop somewhere. I have left it running for hours, and it is still stuck at the same replace statement. Is there something I'm missing?

    C / C++ / MFC help html question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups