CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Data Control

  1. #1
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Data Control

    I've got this program, when I want to use the VB Dataform Wizard to connect to a database, and include the fields, it throws me an error. So, now I want to make use of the "normal" Data Control, to do the same, the problem is: How can I include Add, Delete, Edit, Update, and Close buttons to use with the Data Control¿
    Can any one help, Please¿

    F. T. W.

  2. #2
    Join Date
    Mar 2001
    Posts
    6

    Re: Data Control

    The 'normal' data control can make use of the buttons you wanted. There are a few thing you should understand to make life easier tho Try to follow me...

    I am going to assume you are linking to a MSAccess database.

    1) Place the data control on your form (we will call it Data1 from now on).

    2) Set data1.DatabaseName property to the full path and filename of the database you want to link to. (IE C:\MYPROGRAM\MYDATABASE.MDB)
    **Note: VB Links to MS Access 97 DB's not 2k's DB's, so you must use Access97 DB's.***

    3) Set data1.RecordSource property to the desired table you want to manipulate with data1.(IE tbl_Units)

    there you go. this will link the database to the form. If you want to manipulate the data in data1 you do it through data1.Recordsource. You can pass SQL to the recordsource as well for advanced queries too! Tell me if you need to know more.

    *** Remember if you change the recordsource you should .Refresh after!

    Ans¡


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured