Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Bubi is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    8
    I have tried this and I am now at this stage:

    - Have my users added to Sql Admin table
    - I Get User from user computer and verify it it exists in SQl admin table. If it does application continue if not message appears "Not existing user" and Access closes.

    Connection to SQL server is done through Connection string that I set in code together with password and user name for the whole group that I created in Sql server.
    But now I am asked to provide with option to reset or change in some way the password that I submit to Connection string because I am here temporary and they want to be sure that password get changed.
    Everything looks great and they are satisfied, but now I don't know how could I do this, since password and user name is hard-coded in connection string, that looks something like:

    Public Const strOLEDBConnect = "Provider=Microsoft.Access.OLEDB.10.0;Data Provider=SQLOLEDB;Data Source=MyServerName;Initial Catalog=MyDataBase;User ID=GroupUserName;Password=GroupPassword"


    Thanks a lot

  2. #17
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Instead of making the strOLEDBConnect a public const, why not make it a variable whereby you can change it within the vba code before you connect. You could then put in some code in your startup main form which changes this variable to make the connection. You could also put this connection string within a field in the dbo_AdminTable so that after you grab the user, you can then retrieve what the connection string is for that user.

    I'm thinking that you could also have a TestGroupUserName/TestGroupPassword or have multiple different GroupUserNames/GroupPasswords on SQL Server. Your vba code would then create the appropriate connection string based upon some selection on the Main Menu or based upon a user (ie. if the GetUser = "jkohn" then grab the connection string with the TestGroupUserName and TestGroupPassword, otherwise grab/create a different connection string.) After you leave, the TestGroupUserName on SQL Server could then be deleted without changing any vba coding.

    Just a couple of thoughts.

  3. #18
    alfaista is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    2
    I just work around the shift key issue by adding code to my shut down procedure of the database, if it is an accde/mde, disable the shift key, if it is not, then don't. So far I've been able to go from my development version .accdb to my .accde very easily, with the shift key being set correctly for each file.

  4. #19
    Prophets_Song is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2013
    Posts
    1
    BRAVO, pkstormy! I opened your database and now my Save and Print buttons are permanently disabled. Rebooting didn't work. What a jackass I am to run code I found on this forum...

  5. #20
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Oh wow.....

  6. #21
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by Prophets_Song View Post
    BRAVO, pkstormy! I opened your database and now my Save and Print buttons are permanently disabled. Rebooting didn't work. What a jackass I am to run code I found on this forum...
    See if this db will help!
    Attached Files Attached Files

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Exclusive access/DB lock
    By Boru in forum Access
    Replies: 18
    Last Post: 07-28-2014, 01:38 AM
  2. Automatically Lock Fields
    By Toolman in forum Database Design
    Replies: 2
    Last Post: 05-27-2010, 10:36 AM
  3. Replies: 0
    Last Post: 03-26-2007, 12:24 AM
  4. File sharing lock count exceeded
    By bullwinkle55423 in forum Access
    Replies: 0
    Last Post: 03-22-2007, 11:58 AM
  5. Can I lock out fields in a form by keying off...
    By swampdonkey in forum Access
    Replies: 2
    Last Post: 09-07-2006, 07:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums