Can I write to a database?

Get help with using AutoHotkey and its commands and hotkeys
omar
Posts: 297
Joined: 22 Oct 2015, 17:56

Can I write to a database?

Post by omar » 29 May 2018, 13:11

Can I write to a database everytime I run some code?
Like on a website?
How about locally? I can't think of how this could be done.

I have some code. Everytime it's used, it appends some information at the end of a file.
Today the code ran and the damn file got corrupted. :(
I feel like crying. I didn't have a backup.

For the writing part, I used some ready made AHK code - I was told that this would be more robust.
Something went wrong. Wrong data was received. The data is a CSV file. The first column got wiped out.
I just can't believe it. :(

Assuming writing to a DB will be more secure?

Thanks.
AHKStudent
Posts: 308
Joined: 05 May 2018, 12:23

Re: Can I write to a database?

Post by AHKStudent » 29 May 2018, 14:22

omar wrote:Can I write to a database everytime I run some code?
Like on a website?
How about locally? I can't think of how this could be done.

I have some code. Everytime it's used, it appends some information at the end of a file.
Today the code ran and the damn file got corrupted. :(
I feel like crying. I didn't have a backup.

For the writing part, I used some ready made AHK code - I was told that this would be more robust.
Something went wrong. Wrong data was received. The data is a CSV file. The first column got wiped out.
I just can't believe it. :(

Assuming writing to a DB will be more secure?

Thanks.
backup often to the cloud, databases get corrupted too
gwarble
Posts: 240
Joined: 30 Sep 2013, 15:01

Re: Can I write to a database?

Post by gwarble » 29 May 2018, 18:46

Try opening your now corrupt file with a hex editor, might not all be gone
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
User avatar
Gio
Posts: 471
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Can I write to a database?

Post by Gio » 29 May 2018, 18:57

omar wrote:Can I write to a database everytime I run some code?
Like on a website?
How about locally? I can't think of how this could be done.
Yes, you can. I have been using ADOSQL() by VxE for a long time now to run a multi-user multi-instance logistics system. The DataBase is SQLServer. No big problems thus far.
Assuming writing to a DB will be more secure?
Yes, it is (most of the time). I never had any problems such as the ones you mentioned with my SQL Server DataBase. However, a regular backup is always a plus.
"What is suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
Post Reply

Return to “Ask For Help”