Can I write to a database?

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

Can I write to a database?

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: 287
Joined: 05 May 2018, 12:23

Re: Can I write to a database?

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: 232
Joined: 30 Sep 2013, 15:01

Re: Can I write to a database?

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: 421
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Can I write to a database?

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 !!

Return to “Ask For Help”

Who is online

Users browsing this forum: TAC109, Xtra and 56 guests