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
72
votes
2 answers

Persist Security Info Property=true and Persist Security Info Property=false

For the properties: Persist Security Info=true and Persist Security Info=false Can you tell me what is the difference between them, and if I don't put it in my connection what will happen? connect.ConnectionString =…
Nourah
  • 751
  • 1
  • 5
  • 4
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,260
  • 7
  • 38
  • 61
62
votes
2 answers

VBA shorthand for x=x+1?

Sub btn1_Click() Static value As Integer value = value + 1 MsgBox value End Sub I swear when I was taking a VB.net course in college there was a shorter way to tell a variable to add '' to itself. Maybe x=+1. I am using Access now though instead of…
gregg
  • 1,084
  • 1
  • 12
  • 25
58
votes
2 answers

How can I get this 8 year old VBA 64-bit compiler bug fixed?

So here's the bug: In a 64-Bit VBA host (for example Access 365 64-bit or Excel 2016 64-bit) create a class module SomeClass: ' this needs to be here to trigger the bug: Private Sub Class_Terminate() End Sub and then some module Test: Function…
Nordic Mainframe
  • 28,058
  • 10
  • 66
  • 83
56
votes
6 answers

how to deal with .mdb access files with python

Can someone point me in the right direction on how to open a .mdb file in python? I normally like including some code to start off a discussion, but I don't know where to start. I work with mysql a fair bit with python. I was wondering if there is a…
Richard
  • 15,152
  • 31
  • 85
  • 111
56
votes
2 answers

Difference between Microsoft.Jet.OleDb and Microsoft.Ace.OleDb

It has been a good number of years since I did some programming with Classic ASP and Microsoft Access where we used "Microsoft.Jet.Oledb" driver to access and display the data. I have been asked to do some work with accessing MS Excel data using…
RT88
  • 659
  • 2
  • 6
  • 9
56
votes
8 answers

How to connect R with Access database in 64-bit Window?

When I tried to connect R with Access database I get an error odbcConnectAccess is only usable with 32-bit Windows Does anyone has an idea how to solve this? library(RODBC) mdbConnect<-odbcConnectAccess("D:/SampleDB1/sampleDB1.mdb")
Chris
  • 1,248
  • 4
  • 17
  • 25
55
votes
8 answers

Writing large number of records (bulk insert) to Access in .NET/C#

What is the best way to perform bulk inserts into an MS Access database from .NET? Using ADO.NET, it is taking way over an hour to write out a large dataset. Note that my original post, before I "refactored" it, had both the question and answer in…
Marc Meketon
  • 2,463
  • 1
  • 24
  • 21
55
votes
2 answers

Multiple INNER JOIN SQL ACCESS

Syntax Error (missing Operator) in query expression 'tbl_employee.emp_id = tbl_netpay.emp_id INNER JOIN tbl_gross ON tbl_employee.emp_id = tbl_gross.emp_ID INNER JOIN tbl_tax ON tbl_employee.emp_id - tbl_tax.emp_ID'. SELECT…
emerjohn12
  • 585
  • 1
  • 6
  • 11
55
votes
3 answers

What is the equivalent of Select Case in Access SQL?

I have a query which includes fields named openingbalance and commissions. I would like to compute values for commissions based on openingbalance, similar to this Select Case block in Access VBA: Select Case OpeningBalance Case 0 To 5000 …
Kelly K.
  • 567
  • 2
  • 5
  • 9
55
votes
12 answers

How to open a folder in Windows Explorer from VBA?

I want to click a button on my access form that opens a folder in Windows Explorer. Is there any way to do this in VBA?
VBwhatnow
  • 1,552
  • 2
  • 13
  • 24
52
votes
15 answers

How to add default signature in Outlook

I am writing a VBA script in Access that creates and auto-populates a few dozen emails. It's been smooth coding so far, but I'm new to Outlook. After creating the mailitem object, how do I add the default signature to the email? This would be the…
PowerUser
  • 11,583
  • 20
  • 64
  • 98
51
votes
12 answers

SQL: Using NULL values vs. default values

What are the pros and cons of using NULL values in SQL as opposed to default values? PS. Many similar questions has been asked on here but none answer my question.
Registered User
  • 3,050
  • 5
  • 26
  • 32
48
votes
6 answers

Date Difference between consecutive rows

I have a table with following structure ID Account Number Date 1 1001 10/9/2011 (dd/mm/yyyy) 2 2001 1/9/2011 (dd/mm/yyyy) 3 2001 3/9/2011 (dd/mm/yyyy) 4 1001 …
Mohammed Rishal
  • 649
  • 2
  • 11
  • 13
48
votes
2 answers

Why is "Yes" a value of -1 in MS Access database?

I'm looking at linked data in MS Access. The "Yes/No" fields contain the value -1 for YES and 0 for NO. Can someone explain why such a counter-intuitive value is used for "Yes"? (Obviously, it should be 1 and 0) I imagine there must be a good…
supermitch
  • 2,062
  • 4
  • 22
  • 28