Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Dim qry, db, cs, cn, cmd, adoRec, name
  2.  
  3. 'Query to add all the following which date more than 20 days in the table ToUnfollow
  4. qry = "SELECT Name FROM Follow t1 " & _
  5. "WHERE t1.Joined < datetime(CURRENT_DATE, '-20 days')"
  6.  
  7. db = "C:UsersQuentinDownloadsQuentin-Classementhashtags.db"
  8. cs = "DRIVER=SQLite3 ODBC Driver;Database=" & db
  9.  
  10. 'Connection to database
  11. Set cn = CreateObject("ADODB.Connection")
  12. cn.Open cs
  13.  
  14. Set cmd = CreateObject("ADODB.Command")
  15. Set cmd.ActiveConnection = cn
  16.  
  17. cmd.CommandText = qry
  18. SET adoRec = cmd.Execute()
  19.  
  20. 'Iterate through the results
  21. While Not adoRec.EOF
  22. name = adoRec(0)
  23. MsgBox name
  24. adoRec.MoveNext
  25. Wend
  26.  
  27. 'Close the connection
  28. cn.Close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement