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
32
votes
10 answers

How to extract the schema of an Access (.mdb) database?

I am trying to extract the schema of an .mdb database, so that I can recreate the database elsewhere. How can I pull off something like this?
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
31
votes
12 answers

Using Excel as front end to Access database (with VBA)

I am building a small application for a friend and they'd like to be able to use Excel as the front end. (the UI will basically be userforms in Excel). They have a bunch of data in Excel that they would like to be able to query but I do not want to…
Alex
31
votes
4 answers

Ms Access Query: Concatenating Rows through a query

Suppose I have table in Ms Access with following information: ColumnA ColumnB 1 abc 1 pqr 1 xyz 2 efg 2 hij 3 asd My question is, how can I concatenate the values in the second column to a row value based on the…
reggie
  • 13,313
  • 13
  • 41
  • 57
30
votes
4 answers

How to delete in MS Access when using JOIN's?

I am attempting to use the DELETE clause in MS Access and have an issue when also using the JOIN clause. I have notice this can be accomplished by using the DISTINCTROW key word. For example, the following SQL statement does not allow for…
Curtis Inderwiesche
  • 4,940
  • 19
  • 60
  • 82
30
votes
4 answers

Can we use Interfaces and Events together at the same time?

I'm still trying to wrap my head around how Interfaces and Events work together (if at all?) in VBA. I'm about to build a large application in Microsoft Access, and I want to make it as flexible and extendable as possible. To do this, I want to make…
user2363207
30
votes
3 answers

VBA: Difference in two ways of declaring a new object? (Trying to understand why my solution works)

I was creating a new object within a loop, and adding that object to a collection; but when I read back the collection after, it was always filled entirely with the last object I had added. I've come up with two ways around this, but I simply do not…
Matt
  • 303
  • 1
  • 3
  • 4
30
votes
4 answers

How do I write a full outer join query in access

Original query: SELECT * FROM AA FULL OUTERJOIN BB on (AA.C_ID = BB.C_ID); How do I convert the query above to make it compatible in Microsoft Access? I am assuming: SELECT * FROM AA FULL LEFT JOIN BB ON (AA.C_ID = BB.C_ID); I haven't dealt…
user2924488
  • 301
  • 1
  • 3
  • 3
29
votes
7 answers

Table-less UNION query in MS Access (Jet/ACE)

This works as expected: SELECT "Mike" AS FName This fails with the error "Query input must contain at least one table or query": SELECT "Mike" AS FName UNION ALL SELECT "John" AS FName Is this just a quirk/limitation of the Jet/ACE database engine…
mwolfe02
  • 23,787
  • 9
  • 91
  • 161
29
votes
10 answers

Automatically Generate SQL from existing MS Access table

I've just designed a large database by playing around in MS Access. Now that I'm happy with the design, I need to be able to generate this same database (tables, relationships, etc.) from code. Rather than hand-writing the SQL CREATE statements…
Smashery
  • 57,848
  • 30
  • 97
  • 128
29
votes
3 answers

Bang Notation and Dot Notation in VBA and MS-Access

While perusing an application that I'm documenting, I've run across some examples of bang notation in accessing object properties/methods, etc. and in other places they use dot notation for what seems like the same purpose. Is there a difference or…
Nitrodist
  • 1,585
  • 5
  • 24
  • 34
29
votes
6 answers

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine while data export to MS ACCESS

I am beginner in using Microsft.ACE.OLEDB 12.0. I create a Winforms application VS 2010. And create a function for export data grid data to MS Access file. I using Microsoft Oledb for export the data grid data to MS Access file.But i get this error…
Ragesh P Raju
  • 3,879
  • 14
  • 101
  • 136
29
votes
2 answers

What is the difference between MSSQL and TSQL?

MSSQL and T-SQL are often thrown around as interchangeable synonyms on the web. I know that T-SQL is a flavor of SQL used in many Microsoft products. Is MS-SQL actually another flavor of Microsoft owned SQL or is it just an umbrella term used by the…
Chopo87
  • 1,240
  • 4
  • 19
  • 32
29
votes
5 answers

Wouldn't MS Access(.mdb) file size reduce after deleting the content of database?

I was inserting data into a MS Access database using JDBC-ODBC driver. The blank mdb file was 2KB. After populating this database, the size grew to 155MB. Then I was deleting the data. But I found the size of mdb remains the same as 155MB. I…
Dean
  • 491
  • 2
  • 5
  • 6
29
votes
8 answers

[] brackets in sql statements

What do the brackets do in a sql statement? For example, in the statement: insert into table1 ([columnname1], columnname2) values (val1, val2) Also, what does it do if the table name is in brackets?
Adam Lerman
  • 3,369
  • 9
  • 42
  • 53
28
votes
5 answers

How do I comment SQL code out in Microsoft Access?

Is it possible to comment code out in the SQL window in Microsoft Access?
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062