I am inserting data using below sequence. In this sequence Registry.strFileName[0] is my database path and name. The sequence runs fine and my data gets dump good. However after some time there is an error showing unable to connect database. After restarting the sequence manually same error prevails.
But after restarting Daq Factory project the sequence starts working normally again and data inserting works ok.
while(1)
if (AutoCycleRunning == 1)
dbase = db.OpenEx("Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\Zeal\Hitachi\DB\"+Registry.strFileName[0]+".mdb;Uid=Admin;Pwd=;")
db.Execute(dbase,"INSERT INTO Data_(A1,A2,A3,A4,A5,A6) values ('"+ FormatDateTime("%Y-%m-%d %H:%M:%S", SysTime()) +"','"+Angle_PV[0]/10+"','"+ Torque[0] +"','"+ DC_Current[0]/100 +"','"+ AC_Current[0]/100 +"','"+ PresentCount[0] +"')")
db.Close(dbase)
endif
if (AutoCycleRunning == 0)
delay(1)
db.Close(dbase)
endseq(S3)
endif
delay(0.01)
endwhile