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.

53481 questions
180
votes
9 answers

How to do INSERT into a table records extracted from another table

I'm trying to write a query that extracts and transforms data from a table and then insert those data into another table. Yes, this is a data warehousing query and I'm doing it in MS Access. So basically I want some query like this: INSERT INTO…
Martin08
  • 19,490
  • 20
  • 80
  • 91
167
votes
20 answers

How do you use version control with Access development?

I'm involved with updating an Access solution. It has a good amount of VBA, a number of queries, a small amount of tables, and a few forms for data entry & report generation. It's an ideal candidate for Access. I want to make changes to the table…
Nathan DeWitt
  • 6,321
  • 8
  • 42
  • 65
115
votes
1 answer

Manipulating an Access database from Java without ODBC

I want to manipulate a Microsoft Access database (.accdb or .mdb file) from my Java project. I don't want to use the JDBC-ODBC Bridge and the Access ODBC driver from Microsoft because: the JDBC-ODBC Bridge has been removed from Java SE 8 and is not…
Gord Thompson
  • 98,607
  • 26
  • 164
  • 342
105
votes
28 answers

Good Free Alternative To MS Access

Consider the need to develop a lightweight desktop DB application on the Microsoft platforms. It could be done fairly easily with MS Access but I'd like to be able to distribute it to others and I don't want to pay for a runtime license. …
Onorio Catenacci
  • 14,322
  • 12
  • 75
  • 122
97
votes
2 answers

VBA check if object is set

I have a global variable that is an instance of my custom class. How do I check if the object is set or if I need to initialize it?
Icode4food
  • 7,997
  • 13
  • 54
  • 89
96
votes
8 answers

How to SUM two fields within an SQL query

I need to get the total of two fields which are within the same row and input that number in a field at the end of that same row. This is my code. Sum(tbl1.fld1 + tbl1.fld2) AS [Total] Is this what the SUM function is used for, or can you only use…
Anton Hughes
  • 1,387
  • 3
  • 17
  • 30
84
votes
10 answers

Getting Error 3340 Query ' ' is corrupt while executing queries DoCmd.RunSQL

Since installing the windows update for Office 2010 resolving KB 4484127 I get an error while executing queries which contain a WHERE clause. For example executing this query: DoCmd.RunSQL "update users set uname= 'bob' where usercode=1" Results in…
Zvi Redler
  • 1,490
  • 1
  • 12
  • 21
84
votes
16 answers

SQL Query - Using Order By in UNION

How can one programmatically sort a union query when pulling data from two tables? For example, SELECT table1.field1 FROM table1 ORDER BY table1.field1 UNION SELECT table2.field1 FROM table2 ORDER BY table2.field1 Throws an exception Note: this is…
Curtis Inderwiesche
  • 4,792
  • 18
  • 55
  • 81
81
votes
4 answers

How can I convert an MDB (Access) file to MySQL (or plain SQL file)?

Is it possible to create a Dump of SQL commands from a Microsoft Access database? I hope to convert this MDB file into a MySQL database for importing so I don't have to go through the CSV step. I would expect even an MSSQL dump file to still contain…
700 Software
  • 77,509
  • 74
  • 213
  • 324
78
votes
6 answers

delete all from table

what's faster? DELETE FROM table_name; or DELETE FROM table_name where 1=1; why? does truncate table work in access?
Alex Gordon
  • 51,480
  • 273
  • 609
  • 976
77
votes
3 answers

SQL multiple join statement

When I had only one inner join in my SQL statement, it worked perfectly. I tried joining a second table, and now I am getting an error that says there is a syntax error (missing operator). What is wrong here? adsFormView.SelectCommand = "SELECT *…
Sara
  • 1,483
  • 5
  • 19
  • 27
69
votes
6 answers

Get length of array?

I'm trying to get the length of an array, yet I keep getting this error: Object required Am I doing something wrong? Dim columns As Variant columns = Array( _ "A", "ID", _ "D", "Name") Debug.Print columns.Length ' Error: Object required
lisovaccaro
  • 27,544
  • 92
  • 235
  • 388
68
votes
9 answers

Microsoft.ACE.OLEDB.12.0 provider is not registered

I have a Visual Studio 2008 solution with two projects (a Word-Template project and a VB.Net console application for testing). Both projects reference a database project which opens a connection to an MS-Access 2007 database file and have…
Azim J
  • 8,072
  • 7
  • 36
  • 60
63
votes
15 answers

Determining whether an object is a member of a collection in VBA

How do I determine whether an object is a member of a collection in VBA? Specifically, I need to find out whether a table definition is a member of the TableDefs collection.
inglesp
  • 3,171
  • 9
  • 28
  • 30
59
votes
13 answers

How to find longest string in the table column data

I've a table contains the columns like Prefix | CR ---------------------------------------- g | ;#WR_1;#WR_2;#WR_3;#WR_4;# v | ;#WR_3;#WR_4;# j | WR_2 m | WR_1 d | ;#WR_3;#WR_4;# f9 …
vuyy1182
  • 1,256
  • 9
  • 29
  • 45
1
2 3
99 100