Answer» 10 years ago I wrote many programs in VB4, Now I have VB8 and I need to write one for the company I work for. I remember writing a simple program using a data1 control that would add,edit and delete the data. I know it was just a little simple code. Everything I see is miles and miles of code and modules that I don't need and won't work. I am also having troubble getting the simple codes to work. Like the messagebox command. It doesn't work as written in the books. 10 years ago this was so simple to find. Hmmmmmm maybe in my old age I'm getting stupid. ( PLZ no comments on that ) hehehehe
Does anyone have simple project they can send me I can get the idea from.Can you not use VB4? I recall that it could do both 16bit and 32 bit stuff. And it was cool with database things. And the VB4 book would not break you TOES if you dropped it. I've stayed away from .NET PRETTY much since it came out- I pretty much discovered what you have- They've made everything more difficult, slow, and it's harder to find half the equivalents for VB Classic stuff- such as the Data Control you mention.
A quick look at VB 2005 (which, I believe is VB8) reveals that the default project has a few data-related controls that may be relevant:
BindingSource And BindingNavigator, as well as a "DataSet" control.
Unfortunately I didn't get far with either of these myself- but I'm certain they will be part of the solution- OR-
VB3,4, 5 and 6 each came with "Data" Controls that were intrinsic to the VB runtime. Chances are this is the control you have experience using. Unfortunately, this Control is not AVAILABLE in .NET
On the other hand, .NET does support the use of ActiveX controls. Visual Basic 6 Professional and Enterprise editions both come with a ActiveX control called the "ADO Data Control". In order to get this control into your project, select "Project->Add Reference. Then click the "COM" tab, and scroll down until you see "Microsoft ADO Data Control" in the list. Select it.
It should now be in the toolbox.
the ADO data control should be closer to the Data control you are used to. the only hurdle might be the creation of a connectionstring. I myself have to look it up on google for the proper format, because I forget it EVERYTIME I go to use ADO.
ANOTHER alternative is to reference the DAO libraries and populate your controls via code, but that might be a bit messier then you would like.
Sorry if this didn't actually provide you with a working solution; I haven't used VB .NET and really have no plans to do so in the near future; I hope I pointed you in the right direction.
Quote from: Geek-9pm on FEBRUARY 25, 2009, 01:03:19 AM And the VB4 book would not break you toes if you dropped it.
Probably would have, considering my three VB2 books weigh over 5 pounds... I would guess the manuals got bigger by VB4...
|