Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Microsoft Access
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Development== Access stores all database tables, queries, forms, reports, macros, and modules in the Access Jet database as a single file. For query development, Access offers a "Query Designer", a graphical user interface that allows users to build queries without knowledge of structured query language. In the Query Designer, users can "show" the datasources of the query (which can be tables or queries) and select the fields they want returned by clicking and dragging them into the grid. One can set up joins by clicking and dragging fields in tables to fields in other tables. Access allows users to view and manipulate the SQL code if desired. Any Access table, including linked tables from different data sources, can be used in a query. Access also supports the creation of "pass-through queries". These snippets of SQL code can address external data sources through the use of ODBC connections on the local machine. This enables users to interact with data stored outside the Access program without using linked tables or Jet.<ref>{{cite book|last=Sinclair|first=Russell|title=From access to SQL server|url=https://books.google.com/books?id=CK2WOq4WlPkC|access-date=July 8, 2010|series=Apress Series|year=2000|publisher=Apress|isbn=978-1-893115-24-8|page=39|quote=SQL pass-through queries are queries in which you can enter a statement that is passed directly to the ODBC driver without the Jet engine validating it or parsing it in any way.}}</ref> Users construct the pass-through queries using the SQL syntax supported by the external data source. When developing reports (in "Design View") additions or changes to controls cause any linked queries to execute in the background and the designer is forced to wait for records to be returned before being able to make another change. This feature cannot be turned off. Non-programmers can use the macro feature to automate simple tasks through a series of drop-down selections. Macros allow users to easily chain commands together such as running queries, importing or exporting data, opening and closing forms, previewing and printing reports, etc. Macros support basic logic (IF-conditions) and the ability to call other macros. Macros can also contain sub-macros which are similar to subroutines. In Access 2007, enhanced macros included error-handling and support for [[temporary variable]]s. Access 2007 also introduced embedded macros that are essentially properties of an object's event. This eliminated the need to store macros as individual objects. However, macros were limited in their functionality by a lack of [[Program loops|programming loop]]s and advanced coding logic until Access 2013. With significant further enhancements introduced in Access 2013, the capabilities of macros became fully comparable to VBA. They made feature rich web-based application deployments practical, via a greatly enhanced Microsoft SharePoint interface and tools, as well as on traditional Windows desktops. In common with other products in the Microsoft Office suite, the other programming language used in Access is Microsoft VBA. It is similar to Visual Basic 6.0 (VB6) and code can be stored in modules, classes, and code behind forms and reports. To create a richer, more efficient and maintainable finished product with good error handling, most professional Access applications are developed using the VBA programming language rather than macros, except where web deployment is a business requirement. To manipulate data in tables and queries in VBA or macros, Microsoft provides two database access libraries of [[Component Object Model|COM]] components: # [[Data Access Objects]] (DAO) (32-bit only), which is included in Access and Windows and evolved to ACE in Microsoft Access 2007 for the ACCDE database format # ActiveX Data Objects [[ActiveX Data Objects]] (ADO) (both 32-bit and 64-bit versions) As well as DAO and ADO, developers can also use OLE DB and ODBC for developing native C/C++ programs for Access.<ref name='Development'>{{cite web|url=http://msdn.microsoft.com/en-us/library/cc811599.aspx|title=Developing Access 2007 Solutions with Native C or C++|author=Aleksandar Jakšić|publisher=Microsoft Corporation|date=August 2008|access-date=September 22, 2008}}</ref> For ADPs and the direct manipulation of SQL Server data, ADO is required. DAO is most appropriate for managing data in Access/Jet databases, and the only way to manipulate the [[Complex number|complex field]] types in ACCDB tables. In the database container or navigation pane in Access 2007 and later versions, the system automatically categorizes each object by type (e.g., table, query, macro). Many Access developers use the [[Leszynski naming convention]], though this is not universal; it is a programming convention, not a DBMS-enforced rule.<ref>{{cite web|url=https://technet.microsoft.com/en-us/library/bf926bek(v=VS.80).aspx|title=Naming Conventions|date=July 9, 2007|publisher=Microsoft|access-date=March 13, 2016}}</ref><ref>[http://support.microsoft.com/kb/110264 Naming Conventions for Visual Basic]</ref> It is particularly helpful in VBA where references to object names may not indicate its data type (e.g. tbl for tables, qry for queries). Developers deploy Microsoft Access most often for individual and workgroup projects (the Access 97 speed characterization was done for 32 users).<ref>Kevin Collins (Microsoft Jet [[Program management|Program Management]]), "Microsoft Jet 3.5 Performance Overview and Optimization Techniques", MSDN. Retrieved July 19, 2005.</ref> Since Access 97, and with Access 2003 and 2007, Microsoft Access and hardware have evolved significantly. Databases under 1 GB in size (which can now fit entirely in RAM) and 200 simultaneous users are well within the capabilities of Microsoft Access.<ref>{{cite web|url=http://blog.fmsinc.com/microsoft-access-database-scalability-how-many-users-can-it-support/|title=Microsoft Access Database Scalability: How many users can it support?|work=FMS Software Development Team Blog|date=May 31, 2011|access-date=March 13, 2016}}</ref> Of course, performance depends on the [[database design]] and tasks. Disk-intensive work such as complex searching and querying take the most time. As data from a Microsoft Access database can be cached in RAM, processing speed may substantially improve when there is only a single user or if the data is not changing. In the past, the effect of packet latency on the record-locking system caused Access databases to run slowly on a [[virtual private network]] (VPN) or a [[wide area network]] (WAN) against a Jet database. {{As of|2010|post=,}} broadband connections have mitigated this issue. Performance can also be enhanced if a continuous connection is maintained to the back-end database throughout the session rather than opening and closing it for each table access.{{Citation needed|date=July 2010}} In July 2011, Microsoft acknowledged an intermittent query performance problem with all versions of Access and [[Windows 7]] and [[Windows Server 2008 R2]] due to the nature of resource management being vastly different in newer operating systems.<ref name="AccessSlow">[http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/86e59bc0-3524-45be-89d0-3528cfea842b Very slow Access 2002 query with Windows 7]</ref> This issue severely affects query performance on both Access 2003 and earlier with the [[Jet Database Engine]] code, as well as Access 2007 and later with the Access Database Engine (ACE).<ref name="AccessSlow"/> Microsoft has issued hotfixes [http://support.microsoft.com/kb/2553029 KB2553029] for Access 2007 and [http://support.microsoft.com/kb/2553116 KB2553116] for Access 2010, but will not fix the issue with Jet 4.0 as it is out of mainstream support.<ref name="AccessSlow"/> In earlier versions of Microsoft Access, the ability to distribute applications required the purchase of the Developer Toolkit; in Access 2007, 2010 and Access 2013 the "Runtime Only" version is offered as a free download,<ref>{{cite web|url=http://www.fmsinc.com/MicrosoftAccess/runtime/index.htm|title=Microsoft Access Runtime Distribution Programs and Free Downloads|access-date=March 13, 2016}}</ref> making the distribution of royalty-free applications possible on Windows XP, Vista, 7 and Windows 8.x.<ref>{{cite web|url=http://www.microsoft.com/en-us/download/details.aspx?id=10910|title=Download Microsoft Access 2010 Runtime from Official Microsoft Download Center|publisher=Microsoft|access-date=March 13, 2016}}</ref> ===Split database architecture=== Microsoft Access applications can adopt a split-database architecture. The single database can be divided into a separate "back-end" file that contains the data tables (shared on a file server) and a "front-end" (containing the application's objects such as queries, forms, reports, macros, and modules). The "front-end" Access application is distributed to each user's desktop and linked to the shared database. Using this approach, each user has a copy of Microsoft Access (or the runtime version) installed on their machine along with their application database. This reduces network traffic since the application is not retrieved for each use. The "front-end" database can still contain local tables for storing a user's settings or temporary data. This split-database design also allows development of the application independent of the data. One disadvantage is that users may make various changes to their own local copy of the application and this makes it hard to manage version control. When a new version is ready, the front-end database is replaced without impacting the data database. Microsoft Access has two built-in utilities, Database Splitter<ref>{{cite web|url=http://www.fmsinc.com/MicrosoftAccess/DatabaseSplitter/|title=Microsoft Access Split Database Architecture to Support Multiuser Environments, Improve Performance, and Simplify Maintainability|publisher=Fmsinc.com|access-date=April 24, 2013}}</ref> and Linked Table Manager, to facilitate this architecture. Linked tables in Access use absolute paths rather than relative paths, so the development environment either has to have the same path as the production environment or a "dynamic-linker" routine can be written in [[Visual Basic for Applications|VBA]]. For very large Access databases, this may have performance issues and a SQL backend should be considered in these circumstances. This is less of an issue if the entire database can fit in the PC's RAM since Access caches data and indexes. ===Migration to SQL Server=== {{Main|Upsizing (database)}}To scale Access applications to enterprise or web solutions, one possible technique involves migrating to [[Microsoft SQL Server]] or equivalent server database. A client–server design significantly reduces maintenance and increases security, availability, stability, and transaction logging. Access 2000 through Access 2010 included a feature called the Upsizing [[Wizard (software)|Wizard]] that allowed users to upgrade their databases to Microsoft SQL Server, an ODBC client–server database. This feature was removed from Access 2013. An additional solution, the SQL Server Migration Assistant for Access (SSMA), continues to be available for free download from Microsoft.<ref>{{cite web|url=https://www.microsoft.com/en-us/download/details.aspx?id=54255|title=Microsoft SQL Server Migration Assistant 7.10 for Access|publisher=Microsoft.com|access-date=October 20, 2018}}</ref> A variety of upgrading options are available.<ref>{{cite web|url=http://www.fmsinc.com/MicrosoftAccess/SQLServerUpsizing/how/index.htm|title=When and How to Upsize Microsoft Access Databases to SQL Server|access-date=March 13, 2016}}</ref> After migrating the data and queries to SQL Server, the Access database can be linked to the SQL database, subject to data type conversion limitations: *"Yes/No" types: In Microsoft Access there are three states for the Yes/No (True/False) data type: empty, no/false (0) and yes/true (−1). The corresponding SQL Server data type is binary, with only two states; the permissible values are 0 and 1. *Date/Time (Extended): SQL Server's smalldatetime format has precision of 1 minute, minimum date value is 1900-01-01, maximum date value is 2079-06-06; datetime format has precision of 10/3 milliseconds (rounded to increments of .000, .003, or .007 seconds), minimum date value is 1753-01-01, maximum date value is 9999-12-31; datetime2 format has precision of 100 nanoseconds, minimum date value is 0001-01-01, same maximum date value as datetime. Access's Date/Time and Date/Time Extended have higher precisions than smalldatetime and datetime and datetime2, and wider date range than SQL Server's smalldatetime and datetime formats. Regardless, SQL Server is still the easiest migration. Retrieving data from linked tables is optimized to just the records needed, but this scenario may operate less efficiently than what would otherwise be optimal for SQL Server. For example, in instances where multi-table joins still require copying the whole table across the network. In previous versions of Access, including Access 2010, databases can also be converted to Access Data Projects (ADP) which are tied directly to one SQL Server database. This feature was removed from Access 2013. ADP's support the ability to directly create and modify SQL Server objects such as tables, views, stored procedures, and SQL Server constraints. The views and stored procedures can significantly reduce the network traffic for multi-table joins. SQL Server supports temporary tables and links to other data sources beyond the single SQL Server database. Finally, some Access databases are completely replaced by another technology such as ASP.NET or Java once the data is converted. However, any migration may dictate major effort since the Access SQL language is a more powerful superset of standard SQL. Further, Access application procedures, whether VBA and macros, are written at a relatively higher level versus the currently available alternatives that are both robust and comprehensive. The Access macro language, allowing an even higher level of abstraction than VBA, was significantly enhanced in Access 2010 and again in Access 2013. In many cases, developers build direct web-to-data interfaces using ASP.NET, while keeping major business automation processes, administrative and reporting functions that do not need to be distributed to everyone in Access for information workers to maintain. While all Access data can migrate to SQL Server directly, some queries cannot migrate successfully. In some situations, you may need to translate VBA functions and user defined functions into T–SQL or .NET functions / procedures. Crosstab queries can be migrated to SQL Server using the PIVOT command.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)