Grid and Databases in VC.
-
What grid does a guru use for manipulating a table(adding,inserting,deleting)? I use "DBgrid" and "Remote Data" but i dont have a good control of them. For example i dont know how to catch the exceptions like somebody insert a string in a integer field and many more. There is only VB grid documentation and i dont manage VB. There are not many examples too... If you know VC documentation or source codes about DBGrid,DataGrid, Remote Data or ADO Data let me know, please. If you integrate the one of the CodeGuru grids in databases (not only for retrieve records) please help me. I can deal with ADO and ODBC. Whats your advise, dear guru? Thanks!:|
-
What grid does a guru use for manipulating a table(adding,inserting,deleting)? I use "DBgrid" and "Remote Data" but i dont have a good control of them. For example i dont know how to catch the exceptions like somebody insert a string in a integer field and many more. There is only VB grid documentation and i dont manage VB. There are not many examples too... If you know VC documentation or source codes about DBGrid,DataGrid, Remote Data or ADO Data let me know, please. If you integrate the one of the CodeGuru grids in databases (not only for retrieve records) please help me. I can deal with ADO and ODBC. Whats your advise, dear guru? Thanks!:|
Why not a grid written in C and OleDB/ODBC as DB support? Implement into a DLL a window (not especially an ActiveX), export Register/Unregister from this dll, properties and methods (as every ATL/MFC-like wizard do) as (example):
BOOL
GridCtl_GetColumns(
IN HWND hwndCtl,
OUT PGRIDCOLUMNS **ppColumns
);etc., implement your own paint for header, lines, columns, cells etc.? The DB support: you can choose from the myriad of DB interfaces available (starting from ODBC and DB-Library and ending with OleDB, ADO, DAO, Newton binome of A,D and O - :) - ) and create another dll (or in the same) where you implement the "data source": in the same way, register, unregister, general properties (Server/Source, Catalog/Database etc.), methods/properties (IsBOF, IsEOF, NextRow, Query, Cancel, SetSql, RowCount, GetSql etc.), eventually expose a little rectangle with rewind, back button, in the middle a static with some informations (Connected, Row n Of N etc.) and ending with next/forward buttons (something like: "<< < Row 1 of 10 > >>"). If you need an activex, ok, the ATL object wizard should be a good starting point. Implement what you need (connection points, sinks, events, all the usual stuff). Frankly, I have seen many controls, from simple windows to ActiveX. But I never seen a grid or a data source to like. So I decided to wrote my controls (including grid) in C. It works, until now. (RO: Mai pe romaneste: ce faci cu mina ta... :) ) Cristian 'Sardaukar' Amarie