0

I need help with an SQLite process. It crashed while doing a create query and as a result now will not add a anything to the database as it is "locked"; how can I unlock it?

Other questions answers I don't understand. I need simple as possible please. The database it called "KCD.s3db" I'm working in vb.net.

halfer
  • 19,824
  • 17
  • 99
  • 186
Zac Evans
  • 51
  • 1
  • 8
  • Possible duplicate of http://stackoverflow.com/questions/151026/how-do-i-unlock-a-sqlite-database – tofutim Jan 14 '14 at 17:52
  • As i stated in my question that these didn't work or i don't understand how to do them. – Zac Evans Jan 14 '14 at 18:36
  • Another possibility is that the database still has the process attached to it. Did you try rebooting? – tofutim Jan 14 '14 at 18:42
  • Yeah rebooted, tried from different computer, rebooted new computer, replaced database file with a back up. It just won't let me add or update! It's really important course work! I have a backup from 2 days ago but i might lose all the work i did yesterday! :( – Zac Evans Jan 14 '14 at 18:45
  • Let's get this straight: (1) the sqlite client says it is locked (post an image), but you can add data to it, (2) your vb gives an error when you add or update, (3) the symptom is the same whether the file is on one machine or another and all symptoms persist through rebooting – tofutim Jan 14 '14 at 18:46

2 Answers2

0

Try copying the database to a different location and opening it. Also see How do I unlock a SQLite database?

Community
  • 1
  • 1
tofutim
  • 22,664
  • 20
  • 87
  • 148
  • It opens and writes in the SQL client perfectly! It's when i am trying to write from vb.net program thats the problem! – Zac Evans Jan 14 '14 at 18:35
  • So the database is not locked in the sqlite client? But the error that it is locked comes from vb.net? – tofutim Jan 14 '14 at 18:38
  • It states at the bottom of the SQL client that it is locked but still lets me add to it via the client itself! – Zac Evans Jan 14 '14 at 18:39
0

Basically i forgot to dispose of a query before i ran another query and this caused a reserved lock to be place on the database. Simple fix was to dispose sql command.

Zac Evans
  • 51
  • 1
  • 8