Questions tagged [ms-access]

Microsoft Access, also known as Microsoft Office Access, is an application development and database development tool from Microsoft. It combines the Microsoft Jet/ACE Database Engine with a graphical user interface and software-development tools. Other database engines, such as SQL Server, can also be used as a database server for Access applications.

Microsoft Access, also known as Microsoft Office Access, is an application development and database development tool.

It commonly uses the Jet or ACE database engine, but is not limited to these.

It is a member of the suite of applications, included in the Professional and higher editions or sold separately. The current version is Microsoft Access 2016.
Applications built with Microsoft Access can be distributed to end users with a free run-time version of the application that lets them view databases without needing the full installation of Access.

This tag is version-agnostic. If you have a question about using a specific version, please tag your question appropriately so others know what version you are using. Ex:

and or if your question involves VBA.

Links

Common errors

Reserved Words

One of the most common problems with MS Access SQL is the use of a reserved word in a query or SQL string. It is often suggested that these words are bracketed, [RESERVED WORD], as is required for field (column) names containing spaces or special characters. But rather than trying to figure out what is and is not a reserved word and bracketing only those, using the convention of prefixing all field names with the table name — or better yet, the alias — will prevent this problem from occurring. This will save problems in other cases, not just reserved words. For example:

 SELECT a.id, b.id, b.name 
 FROM tablea a
 INNER JOIN tableb b 

It also makes the SQL compatible with other databases.

Connection Strings

The usual connection string for MS Access *.accdb files, that is, files created in Access 2007 format, is:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;

The ACE connection string is backwards-compatible and will open *.mdb files; however, for *.mdb files, you can also use:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myFolder\myAccess.mdb;

Jet is often installed by default on Windows systems, but ACE is not. ACE is available in both 32-bit and 64-bit.

57313 questions
23
votes
6 answers

Exporting MS Access Forms and Class / Modules Recursively to text files?

I found some code on an ancient message board that nicely exports all of the VBA code from classes, modules and forms (see below): Option Explicit Option Compare Database Function SaveToFile() 'Save the code for all modules to files…
leeand00
  • 25,510
  • 39
  • 140
  • 297
23
votes
2 answers

Is it possible to change the font in the SQL edit window in Access 2007?

It would be nice if there was a right-mouse-click menu on the edit panel to change the font size, but there isn't. Is there a system setting somewhere else that lets me increase the default font size?
Bill
  • 3,806
  • 5
  • 33
  • 45
23
votes
16 answers

MS Access: how to compact current database in VBA

Pretty simple question, I know.
Nick
  • 3,573
  • 12
  • 38
  • 43
23
votes
1 answer

Libraries for connecting node.js to odbc on Windows?

I'm looking for a library that allows node.js to connect to ODBC on windows. All the libraries I have found thus far seem to work with UnixODBC but not windows, can someone please suggest a library that will work with Windows?
leeand00
  • 25,510
  • 39
  • 140
  • 297
22
votes
3 answers

Difference between ADO and DAO

This is not a question about which is better, but rather a question regarding why they differ functionally. The problem I was running into has been handled, but I am curious as to why this behavior is happening. Background - using Excel vba to pull…
APrough
  • 2,671
  • 3
  • 23
  • 31
22
votes
10 answers

Linked Access DB "record has been changed by another user"

I'm maintaining a multiuser Access 2000 DB linked to an MSSQL2000 database, not written by me. The database design is very poor, so you'll have to bear with me. On the 'Customer' form there's a 'Customer_ID' field that by default needs to get the…
ChristianLinnell
  • 1,368
  • 2
  • 16
  • 22
22
votes
2 answers

Cant Create tables in access with pyodbc

I am trying to create tables in a MS Access DB with python using pyodbc but when I run my script no tables are created and no errors are given. My code: #!/usr/bin/env python import pyodbc con = pyodbc.connect(r'DRIVER={Microsoft Access Driver…
wDroter
  • 1,209
  • 4
  • 17
  • 25
22
votes
4 answers

SQL Server Express vs MS Access

A colleague I work with recently told me that SQL Express and MS Access were essentially the same thing; that does not seem to be an accurate statement. I know you can convert Access to a SQL DB and maybe under the covers they are similar, but I…
scarpacci
  • 8,957
  • 16
  • 79
  • 144
22
votes
9 answers

Why should I use SQLite over a Jet database

Someone asked me this the other day, and I couldn't think of a good answer. Platform portability is completely irrelevant to the project. In fact, Jet has some features that SQLite does not, namely foreign keys. So can anyone think why SQLite…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
22
votes
2 answers

How do I make a stored procedure in MS Access?

How do I make a stored procedure in MS Access?
yonan2236
  • 13,371
  • 33
  • 95
  • 141
22
votes
16 answers

MS-access reports - The search key was not found in any record - on save

Occasionally my MS Access reports: The search key was not found in any record After this happens the solution is to close Access, compact and repair the backend and then delete the record. What causes this and how can I avoid it?
pappes
22
votes
2 answers

A select query selecting a select statement

I don't even know if I am doing this query the right way. There is a Sandwiches table that has some 7 fields and 2 of them are comboboxes (Type and Bread). So I made a query that combines all of the comboboxes values into one query, like…
Tony L.
  • 7,988
  • 5
  • 24
  • 28
22
votes
4 answers

where to place CASE WHEN column IS NULL in this query

I'm having some trouble translating an MS Access query to SQL: SELECT id, col1, col2, col3 FROM table1 LEFT OUTER JOIN table2 ON table1.id = table2.id LEFT OUTER JOIN table3 ON table1.id = table3.id so far so good, but here's the (CASE) part…
ivorytux
  • 359
  • 1
  • 3
  • 12
22
votes
9 answers

MS Access RunCode Macro cannot find my procedure

I'm only posting this since I wasn't able to find a solution anywhere. I finally figured it out. Kind of silly really. When using the RunCode property within an Access Macro, I was trying to run a Sub from my global module. I was getting the error…
MultiGuy
  • 912
  • 2
  • 17
  • 34
21
votes
3 answers

How to get logged-in user's name in Access vba?

Possible Duplicate: Is there a way for MS Access to grab the current Active Directory user? I want to get the name of the logged-in User via vba in access. What is the best way to do this? Duplicates of this question: Is there a way for MS…
Varun Mahajan
  • 7,037
  • 15
  • 43
  • 65