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!

Require Simple Example App

Status
Not open for further replies.

darling

Programmer
Oct 25, 2001
14
GB
Hello

I am an Access VBA programmer who has seen the light and I'm switching over to VB6. I have just finished a VB training course and want to start to develop some apps.

I like the idea of COM and using classes and understand the example we were shown. I can also get to grips with creating data connections to SQL databases.

My trouble is that as I'm so used to Access, I want to re-create an app I have already finished but in VB. It is a simple sales database with company information and each company can have many contacts. I need a little pointer to any URL's, white papers, code samples, downloads or whatever which can show me some good data controls.

I need to display company information and the related contacts underneath (used to use subforms in Access) so I can add, delete, amend and search contacts and companies. It is the code to add a record, delete a record, etc via a data container and preferably using classes that I could use the most. The idea I had was to have a contact class which could have method's such as "addnew" and "delete".

If anyone could point me in the direction of some useful help, I would be so happy.

Thanks in advance
Nora
 
One thing you could do is build a small database using the Visual Data Manager in VB. The wizard will build a form with bound controls and generate code to handle all the common recordset operations. The generated code is DAO, but I'm sure it will give you a really good start on databases in VB. Vis Data Mgr is available under Add-Ins. Once it's up, open a .mdb and select Utility - Data Form Designer. Give the form a name (VisData will add "frm" to the beginning of your name), select a table, and choose which fields to include, then click Build The Form. It will create a mini DB app, complete with AddNew/Update and Delete capabilities. If you end up using this generated app in a real project, I recommend you replace the Data1 data control with an Adodc1 (ADO instead of DAO), although some code may have to be changed, it will be similar enough that it makes sense. If you make that change, you'll have to rebind all controls to the Adodc1 via their DataSource property.

Hope that helps!

~Mike
Any man willing to sacrifice liberty for security deserves neither liberty nor security.

-Ben Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top