Link to home
Start Free TrialLog in
Avatar of DistillingExperts
DistillingExperts

asked on

Database Grid Visual Basic 6

How can I create a database grid in a form?
Avatar of ntex
ntex
Flag of Afghanistan image


It really depends the DB source, but basically you add the component if you hadn't yet (CTRL+T).

(Since you didn't specified, I'm going to give a simple example for a MS Access Database)

Then you drag it to the from and size it at your needs.
Then you create a DataControl also on the form. after on the properties of the DataControl, check Databasename and click on it, browse to the MS Access file and select it.

Afterwards just go to the properties of the DBGrid and on "Datasource" on the combo select the DataControl you just add, and it's done.

This is a very simple example, if it's a SQL Database, you will have to use ODBC for example, through ADO.
ASKER CERTIFIED SOLUTION
Avatar of ntex
ntex
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial