Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

General Advice on using ADO data grids

Status
Not open for further replies.

darling

Programmer
Oct 25, 2001
14
GB
Hi

I have written a sales database in Access which works really well. The main form has Company records displayed at the top using text fields and a sub form with contacts for the companies displayed. The option to add and delete, companies and contacts is there too.

I need to convert this to VB6 and SQL. I have produced the SQL database and normalized it. I’m going to use ADO to make connections and manipulate my data. The problem I’m having is that I’m after the best way to display and amend my data.

Should I use text fields mapped to database fields or should I use data grids? I’ve found the data grids that come with VB a little limiting. Are there any that resize to the largest field automatically or are there other ways to add and delete data maybe with a treeview control? Are there any specialist ActiveX grid controls out there that are better than the standard VB ones?

Any pointers as to the best way to have a front end to my SQL data would be fantastic.

Thanks
Nora
 
For what it's worth I found the MSFlexgrid more than adequte for what we do. I think the only thing with it is that you can't bind it to a data source - but again that suits us just fine...
 
You can try a 3rd party grid like one from ComponentOne.

The VB DataGrid(OLEDB) can do mostly what you want except it is limited on formating capabilities (colors, icons, etc). I have been able to program it do do almost everything that a table grid in ACCESS can do, including copying data to the clipboard, inserting data, whether using Ctrl, Shift, Mouse, in order to copy several records in no certain sequence, or blocks of data.
You can format individual columns, automatically formating dates or numbers, column widths based on data width, etc., all in óne command.
But, you need to write alot of serious code to do all this (under ADO even less code).
You can validate/format all data before incoming or outgoing before being shown in the grid or saved to the database. And, under ADO, you do not need to use a DataControl.

With formating, that is where the Flex grid comes in handy. You can format each cell as desired.
Large amounts of records take longer than the data grid to load, but sorting that data once loaded in much, much faster. And, you the user can move columns around - what is also possible with a DataGrid, but alot more code is involved and it takes alot longer to move the column.

And you cannot directly edit the cells in the grid (you need to use a floating edit box - what sametimes response not so smoothly). And exact same record marking or copying functions as under ACCESS are not available either - you also need to write code to handle this.
And you need to loop through the rows to format a column.

There are many advantages and disadvantages for each. What I do is use both. I will almost always use a Flex grid for static, non updateable data under; a ListView control for updatable data that needs formating with colors, etc., and the amount of records possible are less that a certain figure (depends on records:columns)

I'm under the impression that most people in this forum use the Flex grid. So you will get/find alot of expert help here, and with a 3rd party grid, maybe not so much help. [/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
BTW:

The MSFlexgrid can be bound to a DAO datasource.

The MSHFlexgrid Hierarchical OLE DB can be bound to a data source at design time or run time with a Datacontrol or as recordset object.

The same difference holds true for the DBGrid( DAO) and the DataGrid (ADO OLE DB). [/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top