SQLite Database locked in sqlite admin - sql

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.

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

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.

Related

sql server:saving changes to table created

Hello everyone I'm using SQL Server 2008 Management Studio. When I change my database table and try to save changes I got this error
saving changes is not permitted.the changes you have made requires table to be dropped and re created.
And I found that by turning off the prevent saving changes option I can avoid this error. But my question is what are the problems I may face in future by turning off the prevent saving changes option? Is there any other method to avoid this problem?
If you turn off saving change i asume that no change will be made to the table. In my experience, SQL Server Management is not the best way to make changes to an existing table, especialy if got data on it. You will find many cases in wich gives you this error and you have to manualy write the ALTER TABLE to make the changes you want. So my advice is always to use ALTER TABLE. Hope this help.

can't see tables in SQuirrel

I am using a HSQL driver to connect to my database. I am able to connect without any errors but I can't see any of my tables in the table tree under public. I am able to create new tables which do appear, but I can't see the already created ones. Also when I check the .script file I can't see the new tables. Something strange is going on but I can’t work out what.
Anyone able to help.
I've worked it out now. It was the format of the connect string for HSQL.
I needed to add :file: in the string like this... jdbc:hsqldb:file:
Also I was using .script at the end of the file name, like this jdbc:hsqldb:.script
This was creating temp files in the format .script.lck .script.log etc.
Dropping the .script at the end of the file name opened up the database and allowed me to see the tables. Now my problem is I can't get any updates to commit. Updates happen with no errors in the console. But when I close the file and check the .script file the data is the same. Permissions I guess.
Only posting this answer to help others that might get stuck at the same point.
Try here:
How can I list all tables in a database with Squirrel SQL?
Where most of us fails is to choose the right schema in the Catalog dropdown. (Just above the Objects tab). But there are other ideas if you follow the related question.

Create a Jet Database Only using VB.Net

I want to Create a Database that i can publish with a VB.Net Program. I did it just fine Linking MS Access but the problem is what if the user doesn't have Access. So i asked around a bit and one of my teachers said to use a jet database.
Is there a better option for sending a database that the user needs to populate when i publish?
if not!
How can i create a Jet database only in VB.net?
Using this option I will of course need to send 2 programs along one to Populate the data and one to Read and do its job.
Any help would be much appreciated thank you!
If it's a fairly simple database that you are going to be using then you might also want to take a look at sql compact edition. I won't say that this is superior to jet databases but you might find distribution easier.

SQL Server - Checkout system for database objects?

I was wondering if anyone knows any 3rd party tools or existing functionality in SQL Server 2008 so that when someone is working on a table or procedure, it is locked out to that individual. I have searched the net extensively and can't seem to find anything relating to this. We are facing a problem where two people may be working on the same stored procedures and whoever executes last gets the code change! This kind of functionality would come in handy. I think that a lock or check in/check out system would be benefit a project, any ideas?
I am already hooked up to Redgate source control, which does not provide this functionality.
Thanks
Try and have a look at this SO discussion: How do I version my SQL Server database in SVN?
It might not lock things like you want, but it would help to ensure code is recoverable. You could also consider using DDL triggers as some kind of a checking mechanism.
you could try this: http://www.apexsql.com/sql_tools_version.aspx
Alternatively, try this: http://www.red-gate.com/products/sql-development/sql-source-control/entrypage/5-minutes?utm_source=google&utm_medium=cpc&utm_content=unmet_need&utm_campaign=sqlsourcecontrol&gclid=CK_qsPC5prUCFe7MtAodzC8ACA

SQL query and MS Access query returns different data

I use MS Access as a front end to my MS SQL server.
When I use a SQL query in ms Access that is (in my opinion) equivalent to a query I run from the SQL server, Access returns different data. The pictures below illustrate the difference. I use Access 2003 and I have connected the Access table to the SQL server (2008) through ODBC.
Anybody got an idea how to fix this??
Thanks in advance
/Iljitj
The SQL and Access Query and result:
(It's the "Projekt" column that is different)
http://i.imagehost.org/0218/SQL_access_query_and_result.jpg
Okay I solved the problem. Apperently Access won't do anything without a unique identifier. Since I didn't have that in my table, Access used CVRnr as identifier, but since it isn't unique, Access only pulled the first row and dublicated it, hence the "incorrect" data.
I added the unique identifier, and linked it correctly to Access and now it works.
Thanks a lot guys for all your help and suggestions, I don't think I would have ever figured out the cause was the identifier if some of you haven't suggested it.
You saved me ;)
Recreate Access linked table. Sometimes Access internal definitons go bad, especially when there are some changes in linked server data structures, tables/columns are recreated/altered or similar.
BTW, Access itself is certainly not bad, just it is meant for simple desktop 'databasing'. It has many limitations and some quirks, but it is quite usable.
I would just stop using Access. It appears to be very broken. First off let's find out what select statement access is really using.
In SSMS (SQL Server Management Studio) go Tool -> SQL Server Profiler.
Attach to the same database then see what Access is doing. File -> New -> connect -> run.
Ok, I see a couple of things...
Do you have a Primary Key setup for the table on MS SQL? That might be confusing MS Access.
The boolean column do have different values, but I think that's because MS Access likes to represent them differently than the MS SQL. That you're going to have to live with.