Results 1 to 5 of 5

Thread: [RESOLVED] Updating database --- not new record ----

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    114

    Resolved [RESOLVED] Updating database --- not new record ----

    I've finally gotten everything working great the textboxes ,the comboboxes , the database etc I am using ADO code but was has me stuck is this....I can view my data but when I make changes and press my update button my message box pops up, I go to the next record but when I comeback, no changes were saved. I changed to adlockOptimistic. This is the code I'm using to udate changes to a record.

    Private Sub cmdUpdate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    rs.Update
    MsgBox "Student information updated.", vbExclamation

    End Sub


    What am I doing wrong??

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Updating database --- not new record ----

    Are you using the ADODC Data control or are you manually coding all your rs code?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    114

    Re: Updating database --- not new record ----

    I am manually coding rs.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Updating database --- not new record ----

    Then you need to tell it which fields to update.
    VB Code:
    1. rs.Fields("Field1").Value = "Something"
    2. rs.Update
    Last edited by RobDog888; Feb 20th, 2006 at 12:28 AM. Reason: Fix coloring
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Updating database --- not new record ----

    Quote Originally Posted by graphixphantix
    I've finally gotten everything working great the textboxes ,the comboboxes , the database etc I am using ADO code but was has me stuck is this....I can view my data but when I make changes and press my update button my message box pops up, I go to the next record but when I comeback, no changes were saved. I changed to adlockOptimistic. This is the code I'm using to udate changes to a record.

    Private Sub cmdUpdate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    rs.Update
    MsgBox "Student information updated.", vbExclamation

    End Sub


    What am I doing wrong??
    Why don't you use the Click event?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

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