Results 1 to 5 of 5

Thread: Help with SQLite3

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    12

    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

  2. #2

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Help with SQLite3

    Moved to the Database Development forum.

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    12

    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

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width