Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Question Unanswered: Pass Query result into a string.

    Hey guys,
    I am stuck on something hopefully someone will be able to sort my small problem out.

    I am checking of userid and passwords in order for a successful logon to the system i am developing. I want to run a check against a table of user details, check that userid and password are correct.

    select userid, password from table where userid='user input';

    Now the query works for me and returns on screen, but how do i code the result so I can do the check before authorizing access to the system.

    I know I am overlooking something in this case but my mind is now numb and blank, a weekend of beer doesn't help!!!

    Thanks!!

  2. #2
    Join Date
    Oct 2003
    Location
    São Paulo - Brazil
    Posts
    91

    Re: Pass Query result into a string.

    Wich Access are you using ?

  3. #3
    Join Date
    Nov 2003
    Posts
    2

    Re: Pass Query result into a string.

    Sorry, Access 2000
    Cheers!

  4. #4
    Join Date
    Oct 2003
    Location
    São Paulo - Brazil
    Posts
    91

    Re: Pass Query result into a string.

    I usually write something like this:

    Dim rs As ADODB.Recordset
    Set rs = New Recordset


    With rs
    .CursorType = adOpenForwardOnly
    .LockType = adLockOptimistic
    .Source = "SELECT Field1, Field2 FROM myTable where youField = " & yourVariable
    .Open , CurrentProject.Connection

    Write your code

    .close
    end with

    set rs = nothing



    Don´t forget to check the Microsoft Object 3.6 library in the tools/reference box

Posting Permissions

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