# Help Needed As New TO VB



## The Real Yoda (Jun 25, 2001)

I have been programming for about 3 years now and I have become familiar using code. However since I am new to Visual Basic I am not sure of what it can do and how to achieve it.

How Do You Do The Following?

1). Create customised file boxes (Just Like the ones that you see when selecting File>> Open or File>> Save As from a Microsoft Application)

2). How to use Active X Components within my applications

3). How to link Visual Basic applications with Microsoft Database


Any Help Would Be Appreciated

Matt

[email protected]


----------



## theber4 (Jun 26, 2001)

To create File>>Open or File>>Save As, you need to create a menu on an MDI form. An MDI form is simply a container for forms. You will see this choice on VB. Add the MDI form and make your other form or forms child forms. Use menu editor to create your menu like you want. You can tell it what to do in the code on your MDI form. For example, File>>Open would need a common dialogue control on the MDI form. This control usually comes with VB6. Add the control and use it in code. To add it right click on components bar on left and click compononents. Look for Microsoft Common Dialog Control 6.0 and select it and click apply. Add this control to your form. Name it something that is easy to reference in your code(EX: cdlgOpen). On your MDI form, click file and open should should come out underneath it. Double click it and you should be brought into the code section. One line of code should be all you need. The following will bring up a box that lets you browse your computer to select a file to open. (cdlgOpen.ShowOpen). ShowOpen is a method of the common dialogue. Hope this helps. I can explain or clarify a little better for you if you would like, just post a message asking for clarification and let me know on what....


----------



## theber4 (Jun 26, 2001)

Use data controls to link your program to a microsoft database. They aren't very efficient, but they are a good place to start and learn.


----------



## YSB (Mar 7, 1999)

> *1). Create customized file boxes (Just Like the ones that you see when selecting File>> Open or File>> Save As from a Microsoft Application)*


I think what you have in mind is the Common Dialog Control like theber4 said. You can add it to your toolbox by right clicking on the toolbox, select Add Component and check the MS Common Dialog Box.



> *2). How to use Active X Components within my applications*


You add them to your toolbox as above. If they are not in the list you can browse for the ocx file.



> *3). How to link Visual Basic applications with Microsoft Database *


This gets a bit more complicated. There are some very thick books written on this subject. Some only cover parts of the subject and are still pretty thick.

To give a brief overview, there are three major technologies that are used in VB for database access. DAO, RDO and ADO. DAO (I think that's for Data Access Objects) was designed for accessing JET based databases such as MS Access. RDO (Remote Data Objects) was designed for accessing ODBC databases such as SQL Server. ADO (Active-X Data Objects) is a new technology that is supposed to replace DAO and RDO. As it stands now, however, DAO still remains the best bet for JET databases although I think ADO is better than RDO for ODBC or when you need to access both JET and ODBC in the same program.

Each of the three technologies is a world of their own. Each have their own set of objects in the toolbox. Each have pros and cons. Each have their own language. For a beginner, ADO is probably the easiest to learn because it is more streamlined but a basic working knowledge of database concepts and SQL is pretty much a prerequisite of getting full use out of any of them. Personally I have worked with DAO and ADO. I have had some brief encounters with RDO but I can't say that I have really worked with it.

If you have VB6 then a good place to start would be the Data Environment Designer. Go to Project|More Active-X Designers|Data Environment. That let's you set up ADO data objects visually which can then be linked to ADO Data Controls in your forms. Unfortunately the subject is just simply too large to give you much info beyond that in this post. You are going to have to do some more research on the topic on your own. If you have specific questions though, feel free to ask them here and we'll do our best to help.

Good Luck!


----------

