Consulting

Results 1 to 5 of 5

Thread: Excel weird behavior when connecting through ADODB

  1. #1
    VBAX Regular raj85's Avatar
    Joined
    Feb 2010
    Location
    Mumbai
    Posts
    34
    Location

    Excel weird behavior when connecting through ADODB

    Hi Mates,

    I am connecting to Sybase DB using ADODB object and DSN and I have given dropdown to user to select environment to connect (PROD/QA). Sometimes It works for QA perfectly and not for PROD and vice versa.
    I am executing a SP to check database access level of user
     "sp_helpuser 'test'
    and pulls record in a recordset.
    In case of one environment it works perfectly and pull data and for other it not pulling anything.

    I really surprise how this can be possible.

    Please help me with this

    ConnStr = CStr("DSN=" & DSN & ";Uid=" & .[G2] & ";Pwd=" & .Pass_Text)
    End With
    CnSrc1.Open ConnStr
    Sql = "exec sp_helpuser '" & UID & "'"
    Rs1.Open Sql, CnSrc1

  2. #2
    Are you sure both users enter the right credentials?
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  3. #3
    VBAX Regular raj85's Avatar
    Joined
    Feb 2010
    Location
    Mumbai
    Posts
    34
    Location
    Thank you Jan fir your reply.Yes I am testing this tool and I have not yet distributed to the users.I am entering correct credentials.I am able to log in from RapidSQL

  4. #4
    And the user is available in the table the SP is pulling data from?

    What if you (temporarily) change this line:
    Sql = "exec sp_helpuser '" & UID & "'"
    to a fixed SQL string with the username that does work?
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  5. #5
    VBAX Regular raj85's Avatar
    Joined
    Feb 2010
    Location
    Mumbai
    Posts
    34
    Location
    Hi Jan,

    Thank you for the response.

    Yes, User is available in the table the SP is pulling from.
    And I also tried using fixed string "exec sp_helpuser 'rock'" but no luck.

    its so strange it happen for only to query which checks user's database access.
    I also tried replacing below query from ADODB but waste.
    select * from sysusers where name = 'jhonK'

Tags for this Thread

Posting Permissions

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