-
Help with SQLite3
Hi,
I'm familiar with the SQLite2.
I have a code that can List, Edit, Delete, Add, etc.
Recently I started to switch to SQLite3.
I do have a code that can list, but I need help to delete
selected line.
Can you please show me the code lines for this execution.
Thank you in advance
elistein
-
Re: Help with SQLite3
It could be as simple as executing "delete from table_name where..." sql statement via command/connection object.
For SQLite specifics on delete statement read this.
-
Re: Help with SQLite3
Moved to the Database Development forum.
-
Re: Help with SQLite3
Hi ,
I succeeded to delete one entry by the following command:
Set Rs = Cnn.OpenRecordset("DELETE FROM customers WHERE FirstName='John' ")
I want to exchange the exact name 'John' with a selected variant i.e 'SelDelete' that I choose from a list.
How to implement it in the above line command
Thanks
-
Re: Help with SQLite3
1. You did not need to open recordset to delete records - all you had to to do was execute sql via connection (or command object):
cnn.Execute "delete..."
2. You need to build sql string:
Code:
Dim strSQL As String
strSQL = "DELETE FROM customers WHERE FirstName='" & List1.List(LIst1.ListIndex) & "'"
Note: use Replace(List1.List(LIst1.ListIndex), "'", "''") instead in case if any of listitems contain single quote character.