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
28
votes
7 answers

Progress bar in MS Access

I have a query running in Microsoft Access 2010 and it takes over 30 minutes to run normally. I would like to present the end user with some status of the query. A progress bar would be nice but not required. Access seems to be poorly threaded and…
Menefee
  • 1,475
  • 1
  • 17
  • 26
28
votes
4 answers

MS Access library for python

Is there a library for using MS Access database in python? The win32 module is not as easy as the MySQL library. Is there a simpler way to use MS Access with Python?
Vicky
  • 1,657
  • 6
  • 23
  • 33
27
votes
7 answers

Setting up an MS-Access DB for multi-user access

We're thinking of "growing" a little MS-Access DB with a few tables, forms and queries for multiple users. (Using a different back-end is another, but more long-term option that is unfortunately currently not acceptable.) Most users will be…
Thorsten
  • 12,921
  • 17
  • 60
  • 79
26
votes
1 answer

Null values for variables in VBA

How do I define a Null string, date or integer in VBA? I need to be able to assign a Null value to some fields for certain records when data is incomplete or irrelevant, but if I declare a variable as a String, Date or Integer, I get errors when…
HorusKol
  • 8,375
  • 10
  • 51
  • 92
26
votes
1 answer

Bugs in OrderByOn property in Microsoft Access 2010

The setup is a mySQL database on a remote server, using MS Access 2010 as front-end user interface. Problem occurs in forms based on underlying sorted queries, where default view is Continuous Forms: OrderByOn property is False by default – not…
Rossi
  • 609
  • 6
  • 14
26
votes
6 answers

Now() function with time trim

So the function =Now()....is there a way I can use this and only get the date, not the time? or is there just a function for this idea?
Justin
  • 4,461
  • 22
  • 87
  • 152
25
votes
5 answers

Is there an equivalent to the SUBSTRING function in MS Access SQL?

I want to do something like this within an MS Access query, but SUBSTRING is an undefined function. SELECT DISTINCT SUBSTRING(LastName, 1, 1) FROM Authors;
CoderDennis
  • 13,642
  • 9
  • 69
  • 105
25
votes
2 answers

GUI interface for sqlite data entry in Python

I am making a simple sqlite database for storing some non-sensitive client information. I am very familiar with python+sqlite and would prefer to stick with this combo on this project. I would like to create an simple GUI interface for data entry…
Geraldo
  • 251
  • 1
  • 3
  • 3
25
votes
9 answers

Textbox null problem

I have a textbox and a button on my Access form. In the click event of the button i want to see if the textbox is empty, if it is, nothing will be executed. So i use If Me.textbox.Value = Null Then Exit Sub End if But it doesn't work... I…
darkjh
  • 2,821
  • 7
  • 35
  • 43
25
votes
2 answers

How do I use parameters in VBA in the different contexts in Microsoft Access?

I've read a lot about SQL injection, and using parameters, from sources like bobby-tables.com. However, I'm working with a complex application in Access, that has a lot of dynamic SQL with string concatenation in all sorts of places. It has the…
Erik A
  • 31,639
  • 12
  • 42
  • 67
25
votes
14 answers

Access 2013 - Cannot open a database created with a previous version of your application

I have an Access database created more than 10 yrs back. I have very important data in it & I think it can be opened in Access 2007 or earlier version. Currently I have Access 2013 in my desktop and opening the file with this version results in the…
Uma Ilango
  • 968
  • 4
  • 16
  • 31
25
votes
11 answers

Front-End for MS Access migration?

Background I work for a large organization which has thousands of MS Access applications floating around. I didn't write any of these - in fact, most of the original authors have long since left the company - but from time to time another Access…
AJ.
  • 13,461
  • 19
  • 51
  • 63
25
votes
10 answers

Escaping ' in Access SQL

I'm trying to do a domain lookup in vba with something like this: DLookup("island", "villages", "village = '" & txtVillage & "'") This works fine until txtVillage is something like Dillon's Bay, when the apostrophe is taken to be a single quote,…
inglesp
  • 3,299
  • 9
  • 32
  • 30
25
votes
2 answers

Using Excel VBA to export data to MS Access table

I am currently using following code to export data from worksheet to MS Access database, the code is looping through each row and insert data to MS Access Table. Public Sub TransData() Application.ScreenUpdating = False Application.EnableAnimations…
Ahmed
  • 285
  • 1
  • 9
  • 16
24
votes
4 answers

MS Access - execute a saved query by name in VBA

How do I execute a saved query in MS Access 2007 in VBA? I do not want to copy and paste the SQL into VBA. I rather just execute the name of the query. This doesn't work ... VBA can't find the query. CurrentDb.Execute queryname
tdjfdjdj
  • 2,391
  • 13
  • 44
  • 71