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

  • Home
  • SEARCH
  • 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 1027357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:13:43+00:00 2026-05-16T12:13:43+00:00

I have an Access 2003 project in which all data is stored in SQL

  • 0

I have an Access 2003 project in which all data is stored in SQL Server 2008. I am using ADO to view/update data via forms that are completely unbound. For example, a form has several textboxes and combo boxes on it. When the form is loaded I use ADO to make a call to a stored procedure on SQL SQL, it returns a recordset and I populate the controls, via VBA, with the data from the recordset. I like this approach because only the VBA is stored within Access. No data (well actually connection strings are stored in Access, but that is it!).

My problem is what to do when it comes to reports. I want to create reports that are based off of views created within SQL Server, however I would like to avoid, if possible, static linking to the views directly from within Access. Is it possible to set the recordsource of a report dynamically at run-time to be the results of a SQL Server view? If it is, how does one go about designing the report id Access does not contain any data?

More info … The reason I want to avoid linking to the view in Access is the environment in which the Access application could be run changes (Production, Development, Test). Currently whenever I make any calls to the database stored procedures, I look up the connection string (Active Directory based so no passwords are stored) in the only table that is stored in Access .

Thanks for any assistance.

  • 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-16T12:13:44+00:00Added an answer on May 16, 2026 at 12:13 pm

    First of all let’s be clear: you don’t have an Access 2003 “project.” You have an Access 2003 database.

    An actual Access Data Project cannot have local tables, and uses a SQL Server as the back end. When you view Tables you see the ones that exist on the server, and under Queries you see the views, functions, and stored procedures that exist on the server. You can use the “Upsize Wizard” to turn an Access database into an Access data project (or probably better, just create a new ADP (Access Data Project) and import all the forms, reports, macros, and modules.

    Here are my ideas:

    1. Convert the database to an actual Access Data Project and then just use regular old queries as if they were addressed to the local database. You can even bind forms to stored procedures and they can be updatable. To deal with Production, Development, and Test, you just change the connection string in the GUI or you change it through code like so:

      Application.CurrentProject.CloseConnection
      Application.CurrentProject.OpenConnection NewConnString
      

      If you want to read the connection string from a centralized database or from a text file on a share or from a common table you load in each environment (that has the connection information for every other environment), that is up to. I have one Access Data Project that has an toolbar with an Environment dropdown. When the environment is switched, a child database dropdown is then populated, and finally all open forms are notified by an event (though bound forms close when this occurs).

    2. There’s nothing wrong with using linked tables. Just write a procedure that loops through all the tables and updates them to point to the correct server when you want to change environments. The difference between “static” linking and “dynamic” linking is just a single VB procedure that rips through all the tables and relinks them–easy peasy.

    3. Setting a report recordset dynamically at runtime is problematic. It MIGHT be possible in actual Access Data Projects, but definitely not in regular MDBs.

    4. You CAN create pass-through queries in an Access MDB, but I’m not sure about passing parameters in. You’d probably have to set the query text dynamically with the parameters hard-coded and then run the report. This would be a problem for a multi-user database unless each person gets his own front-end to run from.

    I recommend that you go with option 1 or 2. Option 1 seems simplest but there is some learning to do before you’ll become facile with ADPs over MDBs. Let me know if you think you’ll go down that route and I I’ll share some of the gotchas with you. However, it’s probably easier than what you’re doing now which is everything manually. (Ouch!) The second option would be fastest for implementing right away and not throwing any wrenches into your current skill with MDBs.

    UPDATE

    So if you want to link tables, here’s some code to get you started:

    Sub TableRelink(MdbPath As String)
       Dim Table As DAO.TableDef
       Dim Tables As DAO.TableDefs
       Set Tables = CurrentDb.TableDefs
       For Each Table In Tables
          If Table.SourceTableName <> "" Then 'If a linked table
             Table.Connect = ";DATABASE=" & MdbPath 'Set the new source
             Table.RefreshLink
           End If
       Next
    End Sub
    

    This code is for MDB files, but some digging will quickly give you the correct properties and values to use for SQL Server linked tables.

    Another Thought

    I just thought of another possible way to handle just the problem you’re experiencing: Use a session-keyed “temp” table in Access. Create a local table that has all the columns the view returns, plus a GUID column. When the report is run, insert the contents of the view to the local table, keyed by a new GUID value. Set the recordsource of the report to SELECT * FROM MyViewTempTable WHERE GUID = ‘{GUID}’. Simple problem solved. On report_close, delete from the table. Perhaps put in a date also and delete after 10 days in case any rows get left behind.

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

Sidebar

Ask A Question

Stats

  • Questions 517k
  • Answers 517k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace IndexOfAny… May 16, 2026 at 8:01 pm
  • Editorial Team
    Editorial Team added an answer You can do that using reshape and shape intrinsics. Something… May 16, 2026 at 8:01 pm
  • Editorial Team
    Editorial Team added an answer I understand! I don't need real length estimation on this… May 16, 2026 at 8:01 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I inherited an access 2003 ADP file which uses sql 2000 as it's data
I am upscaling an access 2003 database to SQL Server Express 2008. The tables
I have been tasked with writing an ADP application using Access. The back-end data
I have an MS Access 2003 mdb and mdw which is connected to a
I have a database in Access 2003 that I only want certain people to
I have been successful in querying a Microsoft Access 2003 database (.mdb file) and
I keep running into all sorts of nuances between the web site project versus
I've an XML file stored in App_Data which is only used to read some
I recently upgraded to MS Access 2010. When I open a certain .mdb (2000-2003
We are planning to create two sharepoint web applications using SharePoint 2010 Enterprise Edition.

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.