SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
Using Queries within Microsoft Access VBA
Course Title |This is the slide title
Create Query
Delete Query
Modify Query

Parameters
Create Table

Antonio Soto
http://www.ithelp4u.ca/en/ jsoto2000@gmail.com
SOFTWARE ENGINEER, MCT, MCP, MCDBA, MCAD
Create Queries in Access This is theVBAtitle
Course Title | with slide
Create Query
Create Query
Delete Query
Modify Query

Parameters
Create Table

SQL queries in Access are an essential tool for
allowing the user to view and update data. In a
relational database, it is very rare to obtain
meaningful data from a single table. Queries join
tables together, or they can be used to update,
delete, or append records.
When a form is being used, it is sometimes useful
to either create a new query to do something
specific or to change the SQL to adapt to changes
that the user is making.

www.ithelp4u.ca/en

2
Create Queries in Access This is theVBAtitle
Course Title | with slide
Create Query
Create Query
Delete Query
Modify Query

Parameters
Create Table

www.ithelp4u.ca/en

3
Create Queries in Access This is theVBAtitle
Course Title | with slide
Create Query
Create Query
Delete Query
Modify Query

Parameters
Create Table

Inside the Database object, you will find the QueryDefs collection.
This collection holds all the queries in your application.
www.ithelp4u.ca/en

4
Deleting a Query in VBA Access slide title
Course Title |This is the
Create Query
Delete Query
Delete Query

We can also use VBA to delete queries
from the QueryDefs collection.

Modify Query

Parameters
Create Table

We can see what is in this collection by
looking at your queries within the
Navigation pane of Access.
The QueryDefs collection reflects exactly
what appears in the pane.

www.ithelp4u.ca/en

5
Deleting a Query in VBA Access slide title
Course Title |This is the
Create Query
Delete Query
Delete Query
Modify Query

Parameters
Create Table

√ Objects created in code are not automatically refreshed in the Navigation
window until you execute the RefreshDatabaseWindow command.
www.ithelp4u.ca/en

6
Modify a Query in VBA Accessthe slide title
Course Title |This is
We can change the SQL in an Access query by using the SQL property of
the query definition.
Create Query
Delete Query
Modify Query
Modify Query

Parameters
Create Table

www.ithelp4u.ca/en

7
Modify a Query in VBA Accessthe slide title
Course Title |This is - Execute
Create Query
Delete Query
Modify Query
Modify Query

Parameters
Create Table

We can construct the SQL in program code and then execute the
code by using either CurrentDB.Execute strSQL or DoCmd.RunSQL
strSQL.
The CurrentDb.Execute() method offers many advantages over
RunSQL. Trappable Errors, a Count of affected records, as well as no
warning dialogs regardless of the SetWarnings setting.
The best advantage is the ability to trap and handle errors in the SQL
processing: something that you can't do with DoCmd.RunSQL. To
enable this, use the dbFailOnError option when executing the
statement:
CurrentDb.Execute "DELETE * FROM MyTempTable", dbFailOnError
This redirects any errors encountered by Jet to your procedures error
handler.

www.ithelp4u.ca/en

8
Creating parameters in a QueryDef by using code

Course Title |This is the slide title

If we want to create parameters in program code, we do this in the SQL
Create Query
Delete Query
Modify Query

Parameters
Parameters
Create Table

www.ithelp4u.ca/en

9
Create Table Structures

Course Title |This is the slide title

Create Query
Delete Query
Modify Query

Parameters
Create Table
Create Table

 As your Access application is running, there may be
a need to create a table on-the-fly or amend a table
structure. For example, you may be importing data
into a table from a text file. If for any reason the
data in the field in the text file is too large for the
field in your table, it will be truncated and data will
be lost.
 You may also wish to create a table for a specific
operation, do that operation, and then delete the
table.
 You can also change the properties of each
individual field, such as whether it is a required
field or whether it is indexed.

www.ithelp4u.ca/en

10
Create Table Structures

Course Title |This is the slide title

Create Query
Delete Query
Modify Query

Parameters
Create Table
Create Table

www.ithelp4u.ca/en

11
Create Table - Data Definition DDL

CourseAccess supports Data Definition Language (DDL) instructions, which
Title |This is the slide title
is part of the SQL Standard.

Create Query
Delete Query
Modify Query

Parameters
Create Table
Create Table

www.ithelp4u.ca/en

12
Create Table – List Tables

Course Title |This is the slide title

The TableDefs collection contains Table Definition objects; these are all the physical tables, linked tables, and
system tables in the Access database. The following code lists all of the tables and linked tables in the database:

Create Query
Delete Query
Modify Query

Parameters
Create Table
Create Table

www.ithelp4u.ca/en

13
Thank you / Merci / Gracias the slide title
Course Title |This is
Create Query
Delete Query
Modify Query

Parameters
Create Table

14

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Kürzlich hochgeladen (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Using Queries within Microsoft Access VBA

  • 1. Using Queries within Microsoft Access VBA Course Title |This is the slide title Create Query Delete Query Modify Query Parameters Create Table Antonio Soto http://www.ithelp4u.ca/en/ jsoto2000@gmail.com SOFTWARE ENGINEER, MCT, MCP, MCDBA, MCAD
  • 2. Create Queries in Access This is theVBAtitle Course Title | with slide Create Query Create Query Delete Query Modify Query Parameters Create Table SQL queries in Access are an essential tool for allowing the user to view and update data. In a relational database, it is very rare to obtain meaningful data from a single table. Queries join tables together, or they can be used to update, delete, or append records. When a form is being used, it is sometimes useful to either create a new query to do something specific or to change the SQL to adapt to changes that the user is making. www.ithelp4u.ca/en 2
  • 3. Create Queries in Access This is theVBAtitle Course Title | with slide Create Query Create Query Delete Query Modify Query Parameters Create Table www.ithelp4u.ca/en 3
  • 4. Create Queries in Access This is theVBAtitle Course Title | with slide Create Query Create Query Delete Query Modify Query Parameters Create Table Inside the Database object, you will find the QueryDefs collection. This collection holds all the queries in your application. www.ithelp4u.ca/en 4
  • 5. Deleting a Query in VBA Access slide title Course Title |This is the Create Query Delete Query Delete Query We can also use VBA to delete queries from the QueryDefs collection. Modify Query Parameters Create Table We can see what is in this collection by looking at your queries within the Navigation pane of Access. The QueryDefs collection reflects exactly what appears in the pane. www.ithelp4u.ca/en 5
  • 6. Deleting a Query in VBA Access slide title Course Title |This is the Create Query Delete Query Delete Query Modify Query Parameters Create Table √ Objects created in code are not automatically refreshed in the Navigation window until you execute the RefreshDatabaseWindow command. www.ithelp4u.ca/en 6
  • 7. Modify a Query in VBA Accessthe slide title Course Title |This is We can change the SQL in an Access query by using the SQL property of the query definition. Create Query Delete Query Modify Query Modify Query Parameters Create Table www.ithelp4u.ca/en 7
  • 8. Modify a Query in VBA Accessthe slide title Course Title |This is - Execute Create Query Delete Query Modify Query Modify Query Parameters Create Table We can construct the SQL in program code and then execute the code by using either CurrentDB.Execute strSQL or DoCmd.RunSQL strSQL. The CurrentDb.Execute() method offers many advantages over RunSQL. Trappable Errors, a Count of affected records, as well as no warning dialogs regardless of the SetWarnings setting. The best advantage is the ability to trap and handle errors in the SQL processing: something that you can't do with DoCmd.RunSQL. To enable this, use the dbFailOnError option when executing the statement: CurrentDb.Execute "DELETE * FROM MyTempTable", dbFailOnError This redirects any errors encountered by Jet to your procedures error handler. www.ithelp4u.ca/en 8
  • 9. Creating parameters in a QueryDef by using code Course Title |This is the slide title If we want to create parameters in program code, we do this in the SQL Create Query Delete Query Modify Query Parameters Parameters Create Table www.ithelp4u.ca/en 9
  • 10. Create Table Structures Course Title |This is the slide title Create Query Delete Query Modify Query Parameters Create Table Create Table  As your Access application is running, there may be a need to create a table on-the-fly or amend a table structure. For example, you may be importing data into a table from a text file. If for any reason the data in the field in the text file is too large for the field in your table, it will be truncated and data will be lost.  You may also wish to create a table for a specific operation, do that operation, and then delete the table.  You can also change the properties of each individual field, such as whether it is a required field or whether it is indexed. www.ithelp4u.ca/en 10
  • 11. Create Table Structures Course Title |This is the slide title Create Query Delete Query Modify Query Parameters Create Table Create Table www.ithelp4u.ca/en 11
  • 12. Create Table - Data Definition DDL CourseAccess supports Data Definition Language (DDL) instructions, which Title |This is the slide title is part of the SQL Standard. Create Query Delete Query Modify Query Parameters Create Table Create Table www.ithelp4u.ca/en 12
  • 13. Create Table – List Tables Course Title |This is the slide title The TableDefs collection contains Table Definition objects; these are all the physical tables, linked tables, and system tables in the Access database. The following code lists all of the tables and linked tables in the database: Create Query Delete Query Modify Query Parameters Create Table Create Table www.ithelp4u.ca/en 13
  • 14. Thank you / Merci / Gracias the slide title Course Title |This is Create Query Delete Query Modify Query Parameters Create Table 14