CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2001
    Posts
    13

    Help with ACCESS/VB

    Good day to everyone. I'm currently creating a database for a client using MS Access 2002. I'm doing a lot of the actual coding with VisualBasic, and ran into a bit of a problem. When the users log in to the database, they enter a username/password for their specific access-rights. I need to take this username and put it in the "LastPersonToUpdate" field in the database table so the last updater is recorded. I have NO idea how to go about this. Any ideas? Either using Access or VB Code?

    Thanks,

    Bill Garrett



  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Help with ACCESS/VB

    Set the connection to the database from VB code and after that execute ans SQL

    sSQl = "update MyTable set LastPersonToUpdate = '" & sUserName & "'"

    cn.Execute sSQL


    where cn is your connection string

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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