Some minor corrections
authorDave Page <dpage@pgadmin.org>
Fri, 6 Jan 2006 12:18:28 +0000 (12:18 +0000)
committerDave Page <dpage@pgadmin.org>
Fri, 6 Jan 2006 12:18:28 +0000 (12:18 +0000)
docs/howto-vb.html

index 4797dbdc00177733d9179219263fb7991ce80b75..21fd618c94cf8130a6143a6e7fcacbf19eb0a2c1 100644 (file)
@@ -56,11 +56,14 @@ Dim rs as New ADODB.Recordset
           "PWD=&lt;MyPassword&gt;;" &amp; _\r
           "Database=&lt;MyDatabaseName&gt;"\r
  \r
+  'Clear the table\r
+  cn.Execute "DELETE FROM vbtest;"\r
+  \r
   'For updateable recordsets we would typically open a Dynamic recordset.\r
   'Forward Only recordsets are much faster but can only scroll forward and \r
   'are read only. Snapshot recordsets are read only, but scroll in both \r
   'directions. \r
-  rs.Open "SELECT id, data FROM vbtest", cn, adOpenDynamic\r
+  rs.Open "SELECT id, data, accessed FROM vbtest", cn, adOpenDynamic, adLockOptimistic\r
  \r
   'Loop though the recordset and print the results\r
   'We will also update the accessed column, but this time access it through \r
@@ -83,7 +86,7 @@ Dim rs as New ADODB.Recordset
   cn.Execute "INSERT INTO vbtest (id, data) VALUES (23, 'Some random data');"\r
 \r
   'Refresh the recordset to get that last record...\r
-  rs.Refresh\r
+  rs.Requery\r
 \r
   'Get the record count\r
   rs.MoveLast\r
@@ -125,4 +128,4 @@ End Function
 </p>\r
 \r
 </body>\r
-</html>
\ No newline at end of file
+</html>\r