Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Make Sure to Use Rs.Update
Alex Lewis 
       
3 days ago
Had a stupid, easy-to-fix bug in my code. The issue is described below and has since been fixed.

I was in my database trying to update an ADO Recordset in my code. The Recordset I was trying to update was supposed to automatically unlock a locked user’s account after a specific interval of time, and the records in my table on SQL Server didn’t properly update.

I spent about a week pulling my hair out trying to figure out what the problem was. Turns out I forgot to use rs.Update. I made sure to put rs.Update on every line of code where the Recordset made any changes to records.

My code is too complex, so I won’t post it here, but the point I’m trying to make is if you’re updating any recordsets in your database in VBA, make sure to write rs.Update to make sure the changes actually write to the table, otherwise if you’re not super familiar with Recordset programming (or sometimes even if you are), it’s a simple step that’s very easy to forget like I did.
Richard Rost  @Reply  
          
3 days ago
Yep, that's right up there with forgetting rs.MoveNext and wondering why your database locks up.
Alex Lewis OP  @Reply  
       
3 days ago
Richard Ah yes, it seems easy to learn, easy to write and easier to forget. Same with forgetting rs.EOF and not understanding “Invalid Use of Null” errors.

No amount of coffee is considered too much. 😜
Thomas Gonder  @Reply  
      
3 days ago
That's the difference between a hack and a programmer. A programmer steps line by line through their code to see what it's doing (and dang if VB Editor doesn't make that so easy now). And then s/he goes and checks that against the actual data to see if the desired result happened. It's called validating, a concept one of my early programming professors put a lot of emphasis on. In other words, don't simply trust your code is doing what you think it should. I think it's going to be a lost art with vibing and AI. Well hell, the AI guys confess they have no idea what their artificial code is up to anymore.

We can easily see what happened not only to Detroit auto manufactures (the Pinto example is a good start). The rush to market with untested designs has infected the world. Don't get me started with Tesla and their promises for a better tomorrow. Aggghhhh!
Alex Lewis OP  @Reply  
       
3 days ago
There is a famous saying out there (this is mostly associated with game development, but can apply to any medium, including software/database development):

A delayed game is eventually good, but a rushed game is forever bad.

I used to do game development in my free time using Unreal Engine (recently been considering getting back into it).
Alex Lewis OP  @Reply  
       
3 days ago
I’ve never relied on AI to write my code for me, especially if I don’t already know what the code does. It’s more of a time saver on writing code you already know, and even then it still makes mistakes. AI is only as perfect as the humans that train it.

The issue is most new software developers let AI generate code online and assume it’s good to use without any tweaking (e.g. give me a Recordset of all my active customers from FL).

I peeked at AI-generated code for my solution, and everything I looked at basically would have required me to scratch everything I had and start over, or otherwise had nothing to do with what I was trying to build.

AI knows generally what you need, and will write code for the most basic of use cases, but it doesn’t magically understand your database. It doesn’t automatically understand your relationships, dependencies, error handling, or how the specific pieces of your business’ database puzzle fits together.
Alex Lewis OP  @Reply  
       
3 days ago
And before anyone says anything, yes, I have heard stories of AI overriding human commands. This is also why most employers restrict use of AI in the workplace.

As far as software developers go, I don’t see AI taking over our jobs any time soon.
Thomas Gonder  @Reply  
      
2 days ago
I've said it in other threads, I started getting into ChatGPT AI assisted coding about 6 months ago. It's really good at a few things:
1) AI seems to be able to draw ideas from a variety of projects and use advanced coding techniques.
2) If I give a good explanation of what I want with what tables and code I already have, it does a great job assimilating all that.
3) It's good at asking questions about odd conditions that I haven't considered.
4) Even though it doesn't "know" Access, and works in its own pseudo language, it can put some impressive code together...quickly!
5) It's good at spotting logic errors in my older code.

So, I've found it quite useful in creating the basic code and keeping variables straight. It's saved me hours of hand coding large routines that would take me hours to just type. Now I can spend my time fixing its minor errors, and then stepping through every line, which I would have to do with my own code anyways. Once it knows what I want, it seems very capable of understanding my changes and then adding modifications/enhancements that I think up.
Alex Lewis OP  @Reply  
       
2 days ago
AI definitely does have its place. There are times where AI has helped me debug logic errors in my own code (like forgetting to set rs.AddNew while adding a new record just as an example).

As I previously mentioned, I wouldn’t use it to completely replace human developers, but it is a very useful tool to troubleshoot problems, brainstorm new ideas and prototype new features. And yeah, if you have an existing routine already built and you want to expand on it, AI is very good at bouncing ideas back and forth.

As always, I make sure to test the Spock out of it in a test run before adding it to my main database and always keep backups handy.
Richard Rost  @Reply  
          
27 hours ago
I've been using GPT a lot lately while building course outlines and sample code, and I've found that it's very good as a second set of eyes.

I usually write the code myself first, whether it's a Recordset loop, SQL string, form routine, or whatever I'm teaching. Then I give GPT the finished outline and code and ask it to review it. That's where it really shines. It'll catch things like, "Don't forget to escape quotes in that string," or "You may want to check for Null here before doing that comparison."

That's the kind of stuff that's easy to miss when you've got developer tunnel vision. You're focused on the thing you're building, and sometimes you don't think about all the weird little edge cases waiting in the weeds with a bat.

I don't want AI writing my code from scratch unless I already know what it's doing. But as a proofreader, edge-case checker, and idea generator, it's fantastic.

You do have to train it on your style, though. For example, I still like While...Wend loops. I have my own naming conventions. I don't want DAO in front of every Recordset declaration because DAO is what I use by default. If I'm using ADO, then I'll specify that and usually isolate it in its own module so things stay clear.

So, like any tool, it's not magic. It's not a replacement for understanding your code. But it's great for catching the stuff you might miss when you've been staring at the same routine for an hour and your brain starts saying, "Yep, looks fine," even when your recordset is endless looping...
Alex Lewis OP  @Reply  
       
23 hours ago
Richard As a side note, I checked out your Drink Timer app. I don’t drink enough to justify using it a ton, but it does its job pretty well when I want to relax after a rough day. 🖖
Thomas Gonder  @Reply  
      
20 hours ago
Richard I wrote a text document on my coding standards and add it to every new project chat. GPT is pretty good at following those. If I send a similar routine, it incorporates my style on new code sections it creates. I have to rermind it sometimes though.
Richard Rost  @Reply  
          
5 hours ago
Alex yeah, I'm the same way. I don't drink regularly. Only when I'm on vacation or for a special occasion, like an anniversary, or dinner with Sami, I might have a couple of glasses of wine. I'm not a drinker, which is when I think the drink timer is most important, because people who drink regularly kind of know their limits. Way back in my younger days, when I did drink more often, I knew how many drinks I could tolerate when it was time to take it easy. Now that I'm older and I only drink maybe a couple of times a year, it's much more difficult for me to know where my tolerance level is.

Thomas yeah, I've done the same. I've organized everything into projects under ChatGPT so it knows my writing style. For example, I hate curly quotes. I make it stick to straight low ASCII characters only. My instruction is: if it's not on the keyboard, don't use it. Like em dashes. I hate em dashes, and AI loves to use em dashes. But I've also put my coding standards in there, so it does a pretty good job. It's just once in a while if I start a conversation that's not in a project folder, then it deviates from my instructions. There's only so much room for general overall instructions, so I try to keep things in project folders. For example, I have a TechHelp Video Project folder that knows all my standards, and it also has transcripts of all of the previous TechHelp videos. That's quite a lot, but at least this way it knows that I've already covered, so I don't duplicate stuff. If I do duplicate something, it will warn me then I'll try to come up with a different angle to attack it from.
Add a Reply Upload an Image
Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/21/2026 5:06:07 PM. PLT: 0s