What's the Difference Between DoCmd.RunSQL and CurrentDb.Execute in Microsoft Access
HTML-код
- Опубликовано: 5 сен 2024
- In this Microsoft Access tutorial, I'm going to teach you the difference between DoCmd.RunSQL and CurrentDb.Execute and when you would want to use each.
Mike from Newcastle, England (a Platinum Member) asks: I've been following your Microsoft Access videos for years, and you used to always use DoCmd.RunSQL in your code. But recently, I've noticed you using CurrentDb.Execute instead. What's the difference between the two, and what should I use?
Silver members and up get access to an Extended Cut of this video. Members will learn how to trap errors in db.Execute commands with the dbFailOnError parameter. We will also learn how to count how many records were affected with any SQL command by using the RecordsAffected property.
MEMBERS-ONLY EXTENDED CUT VIDEO:
• RunSQL vs. Execute EXT...
BECOME A MEMBER:
RUclips: / @599cd
or My Site: 599cd.com/THMe...
LEARN MORE:
RunSQL vs Execute: 599cd.com/RunS...
PREREQUISITES:
SQL with Access: 599cd.com/SQLw...
Action Queries: 599cd.com/Acti...
Intro to VBA: 599cd.com/Intr...
LINKS:
Turn Off Warnings: 599cd.com/SetW...
Value From a Form: 599cd.com/Form...
Error Handling: 599cd.com/Erro...
RECOMMENDED COURSES:
Access SQL Seminars: 599cd.com/SQL
Access Developer Courses: 599cd.com/Deve...
RICK'S PICKS:
No Longer Set: nolongerset.com...
DEVelopers HUT: devhut.net
Access Forever: accessforever.org
Denver Area Access Users Group: daaug.org
Access User Groups: accessusergroup...
FREE TEMPLATE DOWNLOADS:
TechHelp Free Templates: 599cd.com/THFree
Blank Template: 599cd.com/Blank
Contact Management: 599cd.com/Cont...
Order Entry & Invoicing: 599cd.com/Invo...
More Access Templates: 599cd.com/Acce...
ADDITIONAL RESOURCES:
FREE Access Beginner Level 1: 599cd.com/Free1
How to Use Access in 30 Minutes: 599cd.com/30Mi...
$1 Access Level 2: 599cd.com/1Dollar
Donate to my Tip Jar: 599cd.com/TipJar
Get on my Mailing List: 599cd.com/YTML
Contact Me: 599cd.com/Contact
TechHelp: 599cd.com/Tech...
Consulting Help: 599cd.com/DevNet
Twitter: / learningaccess
en.wikipedia.o...
products.offic...
microsoft.com/...
KEYWORDS:
access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, What is the difference between docmd.runsql and currentdb.execute, Execute vs RunSQL, CurrentDb.Execute vs. docmd.runsql, suppress warnings, handle errors, dbFailOnError, RecordsAffected, run-time error 3061, too few parameters expected 1
QUESTIONS:
Please feel free to post your questions or comments below. Thanks.
I've always used db.execute, but never really looked or understood the difference. This is what I love about your videos, it's great to cover "basics" that I may have completely missed.
Thanks Richard for the great tips. You're kinda like a life coach for Access developers!
Very intetesting topic! I've using recordsets if I wanted to trap errors instead of currentdb. Execute.
Richard, thanks for the comparison of RunSQL and Execute!
Thank you for this explanation!
You're very welcome!
Do you teach how to create DLL for Access?
Thanx
Still have not posted ant video about CurrentDb.Execute transaction?
Heard "Es -Que-El" in the first 20 seconds. I'm out.
See ya! Don't let the door hit you on the way out... :P