dcsimg
Results 1 to 16 of 16

Thread: [RESOLVED] vb6 Compact & repair sqlite database

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Resolved [RESOLVED] vb6 Compact & repair sqlite database

    hi ..
    how can i Compact & repair sqlite database in vb6 ;
    another here ?
    Last edited by Ami_Tech; Jul 5th, 2019 at 09:30 AM.

  2. #2

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Re: vb6 Compact & repair sqlite database

    Hello ..
    how can i Optimize Sqlite database By Code in VB6 Plz ...
    Last edited by Ami_Tech; Jul 4th, 2019 at 11:40 AM.

  3. #3
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    3,553

    Re: vb6 Compact & repair sqlite database

    You need a special "driver" to work with SQLite DB files.
    This can either be a standard DLL or using a COM wrapper like vbRichClient5

    https://x443.wordpress.com/2007/07/2...al-basic-dlls/
    https://github.com/RobbiNespu/VB6-Sqlite3
    http://www.vbforums.com/showthread.p...ent-Framework)

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Re: vb6 Compact & repair sqlite database

    Arnoutdv
    i have a special driver
    ODBC driver for SQLite
    Just i want to compact database sqlite by code as access database

  5. #5
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    372

    Re: vb6 Compact & repair sqlite database

    Just google for SQLite vacuum
    Carlos

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Re: vb6 Compact & repair sqlite database

    another here ..

  7. #7
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    3,553

    Re: vb6 Compact & repair sqlite database

    What have you tried?

  8. #8

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Re: vb6 Compact & repair sqlite database

    Arnoutdv
    i want repair Sqlite DataBase after Delete Record

  9. #9
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    3,553

    Re: vb6 Compact & repair sqlite database

    I do use SQLite and the vacuum statement, but not using ODBC, so no experience in how to use it.
    I use the vbRichClient5 to work with SQLite databases.

    Do you really want to compact/vacuum after each delete command?

    You are using ODBC for the connection, then are you using ADO for the queries?
    If you are using ADO then you could try the Execute method of the connection object.

  10. #10

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Re: vb6 Compact & repair sqlite database

    Arnoutdv
    Do you really want to compact/vacuum after each delete command?
    yes ..

    You are using ODBC for the connection, then are you using ADO for the queries?
    yes

    If you are using ADO then you could try the Execute method of the connection object.
    you have sample Code ..

  11. #11
    Frenzied Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    1,163

    Re: vb6 Compact & repair sqlite database

    Quote Originally Posted by Ami_Tech View Post
    i want repair Sqlite DataBase after Delete Record
    Why is your database getting corrupted after every DELETE?

    If you really mean only compact (i.e., VACUUM) that is an expensive operation to be doing frequently. If ODBC doesn't support the VACUUM statement, you should be able to do it via the command line tool (sqlite3.exe) that you can spawn from your program. You may need to close the connection first.

  12. #12

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Re: vb6 Compact & repair sqlite database

    topshot
    plz if you have sample code about that

  13. #13

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Re: vb6 Compact & repair sqlite database

    yes yes i mean compact VACUUM

  14. #14

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Re: vb6 Compact & repair sqlite database

    topshot
    Arnoutdv
    Carlos Rocha
    it's work now
    i love you
    thx

  15. #15
    Frenzied Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    1,163

    Re: [RESOLVED] vb6 Compact & repair sqlite database

    Glad you worked it out. Perhaps you can post your final solution for those with a similar issue in the future.

    I hope you are not VACUUMing excessively unless perhaps every delete command is wiping out lots of rows.

  16. #16

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    53

    Thumbs up Re: [RESOLVED] vb6 Compact & repair sqlite database

    yep ..
    Just write this code and it works perfectly
    PHP Code:
    DB.Close
    DB
    .Execute "VACUUM"
    DoEvents 

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width