Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Unanswered: adodc of vb using ms access

    Hi all... I am doing a mini project for my college work... My project is online quiz system... For that i would like to provide a login form thru which the users access the system... I have designed the login form using Visual Basic as the front end and MS-Access as the back end... In access i ahve a db with Username and Password fields... And i have connected the form thru ADODC control to the db... Can anyone provide a coding for this form...

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Welcome to the forums

    Quote Originally Posted by meenutyagi77
    Hi all... I am doing a mini project for my college work... My project is online quiz system... For that i would like to provide a login form thru which the users access the system... I have designed the login form using Visual Basic as the front end and MS-Access as the back end... In access i ahve a db with Username and Password fields... And i have connected the form thru ADODC control to the db... Can anyone provide a coding for this form...
    Please check out the MS Access FAQ page. Noone's here to do the work for you. We'll gladly help you do the work though So tell us what you've done so far, where you're getting stuck, and what you've tried to get unstuck, and we'll see what we can do to help you overcome it.
    Me.Geek = True

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Do it yourself?

    I certainly don't work for free...

    And from what you've said, you should be asking for people to do your work for you in the VB area, not Access since you're only using Access as the back end.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Here's my vb login script. It doesn't qc the username/password but you can use it as an example in your design of your vb form. Otherwise, you can look at some examples in the code bank for permission type forms for MSAccess:

    Set WSNet = CreateObject("WScript.Network")

    varUserName = WSNet.UserName

    if varUserName = "" then WScript.Quit

    Set WSNet = Nothing

    Set MyConn = CreateObject("ADODB.Connection")
    Set RS = CreateObject("ADODB.Recordset")

    MyConn.open = "DRIVER={SQL Server};"_
    & "SERVER=<serverIPorName>;"_
    & "DATABASE=<databasename>;"_
    & "Uid=<username>;"_
    & "Pwd=<password>;"

    Dim rst
    set rst = createobject("ADODB.Recordset")
    queryString = "SELECT * FROM dbo.Users where LoginID = '" & varUserName & "'"
    'rst.Open queryString, MyConn, adopenkeyset, adlockreadonly
    rst.Open queryString, MyConn

    Dim CC

    CC = 0

    while not rst.eof
    CC = CC + 1
    rst.movenext
    wend
    RST.Close
    Set RST = Nothing

    if CC < 1 then
    Dim LogID
    LogID = inputbox("Your LoginID was not found for the WhosIn/Out program (one time entry), please enter your login name: (you will not be asked this again.) - contact dbadmin if you have any questions." & vbcrlf & "Please enter your loginID:")
    if LogID = "" then wscript.quit
    Dim FullName
    FullName = inputbox("Now Please enter your FULL name:")
    if FullName = "" then wscript.quit
    SQL = "INSERT INTO dbo.Users(LoginID, UserFullName) Select '" & LogID & "', '" & FullName & "'"
    MyConn.execute(SQL)
    SQL = "UPDATE dbo.Users SET LoginStatus ='" & "LoggedIn" & "' WHERE LoginID ='" & varUserName & "'"
    MyConn.execute(SQL)
    MyConn.Close
    msgbox "Thank You. " & LogID & " has been registered. If you are a WhosIn/Out tester, you're login/logout status will show for others (and you can see theirs)."
    else
    SQL = "UPDATE dbo.Users SET LoginStatus ='" & "LoggedIn" & "' WHERE LoginID ='" & varUserName & "'"
    MyConn.execute(SQL)
    MyConn.Close
    end if

    Set MyConn = Nothing
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    PK gets an "A" ^^
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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