Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6578561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:47:11+00:00 2026-05-25T15:47:11+00:00

Using Ms Access … I am trying to change the user to which I

  • 0

Using Ms Access …

I am trying to change the user to which I am connected to a SQL Server Database from Access. The startup form from my Access Application dynamically connects to the tables via an Altered version of a routine posted on Microsoft’s KB. In Essence it deletes the tabledef that matches the name localName you call it with, Calls Currentdb.CreateTableDef to create a new one with the appropriate new connection string and appends it the the CurrentDb.TableDefs collection. As far as I can see, its the append function that actually contacts the database and throws an error if your connection string is wrong.

In my case, I did an original pass through all the tables in my database calling this routine with an old (standardised – ie I normally use this) string and all tables connect fine.

I am now trying a second pass through this start up form with a new user/password combination so as to test different permissions in the database.

I have then built a new connection string with a revised name and password and am currently single stepping through the function I just described.

I have a variable td which contains the newly created tabledef and I am just prior to appending it to the Currentdb.TableDefs collection

In the debugger “Immediate” window ?td.connect gives the connection string with the newly formed connection string correctly and ?td.name gives tblConfig as the table name.

Just to ensure the TableDef has been correctly deleted from the current collection I did ?CurrentDb.Tabledefs("tblConfig").Connect from the immediate window and was rewarded with a dialog box that said the collection didn’t contain a member with that name

I then single step over the line

CurrentDb.TableDefs.Append td

And now call ?CurrentDb.Tabledefs("tblConfig").Connect again from the debuggers Immediate window and the response is the old connection string not the new one.

There is an OnError active in this routine, but It is not activated during the single stepping.

The only explanation I can think of for this, is that somehow the old connection string is stored on disk as a result of saving the database at some point and append doesn’t copy across the connectionstring when it is finally appended.

Does anyone have a better explanation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:47:11+00:00Added an answer on May 25, 2026 at 3:47 pm

    It turns out that the connection string is indeed cached

    http://blogs.office.com/b/microsoft-access/archive/2011/04/08/power-tip-improve-the-security-of-database-connections.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Access 2003 to access data stored in a SQL Server database
I am using Access database for one system, and SQL server for another system.
I am using Access and have this SQL SELECT land.id, land.official_name, vaksiner.vaksiner FROM land
I am using Access 2003 as a front end UI for a SQL Server
I am creating a database application using Access 2003 that will be run as
I'm using Access (2003 format) as a front-end with a SQL Server 2008 backend.
I am using Access 2007 (VBA - adp) front end with a SQL Server
Using Access 2003 I want to get a table value from the two databases
Using Access 2003 Database Table1 Intime Outtime WorkTime OverTime 08:00:00 19:00:00 09:00:00 02:00:00 09:00:00
Using Access Database Table ID Time 001 100000 001 100005 001 103000 001 102500

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.