DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: update database through ADO

  1. #1
    Join Date
    Apr 2007
    Posts
    16

    How do I create 3d Menus using VB 6.0

    My application is working fine with menus. But my client wants 3d style menus. I tried all web sites including Microsoft's but couldn't get answer.
    An early guidance is highly appreciated.

    reg
    venkat
    Last edited by vkssms; 04-22-2007 at 02:44 AM. Reason: problem solved

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    Do you create adorecset after performing the INSERT?
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    If you dont bind the list to an open recordSet then you will have to clear and reload the list every time you need to refresh it.

    To bind the list to an open ADo recordSet do the following:
    First make sure you are using the DataCombo control
    --The DataCombo control is code-compatible with the DBCombo control. However the DataCombo control is optimized to work with ActiveX Data Objects (ADO).
    Next open a recordset that contains all the items you want in your list and set the the controls recordsource property to the recordset; like this:

    Code:
      'This is how I load my lists
      Set rs = New ADODB.Recordset
      rs.Open "SELECT PK_USER_TYPE, STR_TYPE, F_SORT FROM TBL_USER_TYPE ORDER BY F_SORT;", db, adOpenStatic, adLockOptimistic 
      Set cboUserType.RowSource = rs
    
      'If I need to refresy the list I do this
      rs.Requery
      Set cboUserType.RowSource = rs
    
      'when my form unloads I clean up like this
      set cboUserType.RecordSource = Nothing
      rs.Close
      set rs = Nothing
    In the controls settings itself I set the ListField to STR_TYPE and the BoundColumn I set to the name of the Primary Key PK_USER_TYPE. Now when the user selects an item from the list the value returned is the value from the BoundColumn's field, the primary key.

  4. #4
    Join Date
    Oct 2004
    Location
    Bangalore, India
    Posts
    47

  5. #5
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    Since you have more than one form that all use the msaccess database, I suggest that you use a public variable, that is defined in a module, to hold the connection object. This way the connection can be used by all forms and any recordsets that you need to create. If you are using recordsets to load your combo boxes then the recordset objcet variable should be local to the form and not defined public in a module. This is not to say that you can not share a recordset like this but you will run into problems if more that one form tries to access the records at the same time. If you want to use the same recordset you can get arround this by creating a second recordset object variable that is local to the form but instead of opening a new recordset you can just use the recordset.Clone option. Like This:
    Dim localRs As ADODB.Recordset
    Set localRs = publicRs.Clone
    Now use localRs to do your work and there won't be any conflicts with other forms accessing publicRs because they should all be using their own copy of the localRs variable.
    When you are done with localRs, like when the form actuallty closes, just set it to Nothing.
    Set localRs = Nothing

    Have fun!
    Last edited by Ron Weller; 04-20-2007 at 08:07 PM.

  6. #6
    Join Date
    Apr 2007
    Posts
    16
    Thanx Weller!!!. I have already solved the problem and there are no conflicts in any of my forms.

    How do I create 3d Menus using vb 6.0. I tried many sites including Microsoft's but I am unhappy with the results. If you know please throw some light

    regards
    venkat

  7. #7
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    3d menu?

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Have you tried applying a XP skin to your form?

Similar Threads

  1. Replies: 1
    Last Post: 05-23-2001, 09:35 AM
  2. Replies: 2
    Last Post: 03-02-2001, 11:57 AM
  3. Secured Access database ado connection error
    By Bob Sharp in forum VB Classic
    Replies: 3
    Last Post: 02-12-2001, 12:59 AM
  4. Usage of Update method of Recordset of ADO control
    By Parthasarathy in forum VB Classic
    Replies: 6
    Last Post: 05-23-2000, 07:28 PM
  5. Problems with my update in ado.
    By Jared Doerr in forum VB Classic
    Replies: 0
    Last Post: 04-06-2000, 04:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center