|
-
Jan 3rd, 2024, 01:56 PM
#1
Thread Starter
Frenzied Member
Saving settings to database - insert vs update
I want to use an Sqlite database to save certain program settings. I want the program to load the settings on startup & set the controls accordingly and then save the settings on program exit. This will basically setup the program with the last used settings when opened. I feel like I need to use an update statement to save the settings but that won't work on the first run of the program, because there won't be any settings in the table yet to update. Do I need to check first if the settings exist in the table and if they don't exist then do an insert & if they do exist then do an update? That seems like an inefficient way to do it. There's got to be a better way. Any suggestions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|