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
24
votes
4 answers

Microsoft Access condense multiple lines in a table

I have a question in MS Access 2007 and I hope someone has the answer. I have a long but simple table containing customer names and the days of the week that deliveries are made. I would like to summarize this table by listing the name and all the…
Sam_H
  • 243
  • 1
  • 2
  • 5
24
votes
4 answers

Why does a LIKE query in Access not return any records?

Is there any reason why SELECT * FROM MyTable WHERE [_Items] LIKE '*SPI*' does not return any records with OleDbAdapter.Fill(DataSet) or OleDbCommand.ExecuteReader()? When I run the same SQL in MS Access directly, it returns the expected records.…
Jake
  • 11,273
  • 21
  • 90
  • 147
24
votes
12 answers

SendKeys is messing with my NumLock key via VBA code in Access form

I have the following code for an Access form. It appears as if the SendKeys is messing with my NumLock key by toggling it on and off as I open and close the form. For perfectly valid reasons which I don't want to get into, I really do not want to…
user12059
  • 733
  • 2
  • 13
  • 27
24
votes
4 answers

Working with an Access database in Python on non-Windows platform (Linux or Mac)

I want to access the data in a Microsoft Access database. I have some .accdb and .mdb files and want to read them in Python. From my research, pyodbc can only be used on Windows platform, but I am working on Mac OS X. I am new to Python. The other…
user2948166
  • 599
  • 1
  • 9
  • 17
24
votes
3 answers

Export tables to an excel spreadsheet in same directory

I have two tables in my access database that I want to be able to export to excel. I can do it by opening the table and then doing File->Export... and then choosing the format and typing in the file name. However, this way the user actually has…
Matt
  • 339
  • 2
  • 6
  • 14
24
votes
5 answers

how do you view macro code in access?

I have a Microsoft Access database and there is a macro there. How do I view the code of the macro?
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
24
votes
2 answers

Linked table ms access 2010 change connection string

I am working on a existing MS Access 2010 project that has a linked table link to Sql Server database. When I mouse over to the linked table I can see a connection string 'ODBC;DRIVER=SQL Server;SERVER=10.0.0.1;UID=testdb;APP=Microsoft Office…
Rena Sun
  • 285
  • 1
  • 3
  • 8
23
votes
4 answers

Hand Install of 64-bit MS Access ODBC drivers when 32-bit Office is present

I want to do a hand install of the MS Access 64 bit odbc drivers. Uninstalling 32 bit Office and installing 64 bit Office is not an option due to the add-ins that our company uses. I downloaded the AccessDatabaseEngine_x64.exe and using WinRar and…
JMoney
  • 321
  • 1
  • 2
  • 6
23
votes
6 answers

How to restart counting from 1 after erasing table in MS Access?

I have table in MS Access that has an AutoNumber type in field ID After inserting some rows, the ID has become 200 Then, I have deleted the records in the table. However, when I tried to insert a new row, I see that the ID starts with 201 How can I…
Gold
  • 60,526
  • 100
  • 215
  • 315
23
votes
2 answers

Determine whether a Access checkbox is checked or not

Such a simple question, but I cannot find the answer (Google, MS help, SO): How can I check by VBA whether an unbound checkbox on an Access form is checked by the user or not? Can't find the right property. UPDATE: I used this code after the…
waanders
  • 8,907
  • 22
  • 70
  • 102
23
votes
4 answers

is there a group_concat function in ms-access?

is there a group_concat function in ms-access or something similar?
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
23
votes
4 answers

Insert record into table if entry does not exist in another table- with an extra twist

Hi to all you mighty SQLsuperheros out there.. Can anyone rescue me from imminent disaster and ruin? I'm working with Microsoft Access SQL. I'd like to select records in one table (table1) that don't appear in another (table2) .. and then insert new…
bonzo46
  • 341
  • 1
  • 2
  • 8
23
votes
3 answers

"You tried to execute a query that does not include the specified aggregate function"

SELECT SUM(orders.quantity) AS num, fName, surname FROM author INNER JOIN book ON author.aID = book.authorID; I keep getting the error message: "you tried to execute a query that does not include the specified expression "fName" as part of an…
Tobias Funke
  • 1,614
  • 3
  • 13
  • 23
23
votes
1 answer

MS-Access Debug Watch value length is limited

I am working in MS-Access 2010 and I am trying to view a variable defined in the VBA code where it has hit a break-point. The problem in the watch window the value text box in the Watches window has a set size, in other words if the value is to long…
Mark C
  • 610
  • 2
  • 5
  • 15
23
votes
23 answers

Operation must use an updatable query. (Error 3073) Microsoft Access

On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better way. All the tables involved have a primary key.…
Knox
  • 2,909
  • 11
  • 37
  • 65