Click here to Skip to main content
16,020,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I really need your help!

Im having some trouble in saving data in my system, this was happened about 4 times already. My problem is that every time the user save the files of one patient after the check-up all the previews data of all patient's record was being replaced by the new data inputted. Is there a way to backup all the data every 1 or 2 hours so I can retrieve the previews record, I already have the daily backup.
Thanks in advance!

here is my code in saving data:

SQL
SQL = "Insert into tbl_Main (Employee_ID, Employee_Name, Age, Sex, Division_Name, Department_Name, Section_Name, Position_Description, Appointment, CheckupDate, Findings, Recommendation, Illness, Status)" & _
 "VALUES ('" + Me.lblEmpID.Text.Trim + "', '" + Me.lblEmpName.Text.Trim + "', " + Me.lblAge.Text.Trim + ", " & _
    " '" + Me.lblSex.Text.Trim + "', '" + Me.lblDivision.Text.Trim + "', '" + Me.lblDepartment.Text.Trim + "', " & _
    " '" + Me.lblSection.Text.Trim + "', '" + Me.lblPosition.Text.Trim + "', '" + Me.lblAppointment.Text.Trim + "', " & _
    " '" + Me.dtCheckup.Text.Trim + "', '" + Me.cmbFindings.Text.Trim + "', '" & Me.txtRecommendations.Text.ToString & "', '" & Me.txtIllness.Text.ToString & "', 1)"
Posted
Updated 7-Jul-15 21:26pm
v3
Comments
Suvendu Shekhar Giri 8-Jul-15 3:03am    
What this insert query has to do with your requirement?
Denrich 8-Jul-15 3:35am    
I just give my query so you can check if there is something wrong in it. I really don't know how this problem happened, i don't know if there is some issues regarding the network.
Richard chiu 8-Jul-15 5:37am    
try using sqlparameter instead of inserting the value directly from textbox

1 solution

You can create a batch file and make use of Windows Scheduler to do this
Check the answer by @EduardoMolteni in the following link in StackOverflow
SQL Server Automated Backups[^]
Check following link if you need assistance with scheduling task in windows
Run a batch file with Windows task scheduler[^]

Hope, that helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900