Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is no inbuild method in VB6 to do this (not that I know of), however, it's easy enough to do yourself.</p> <p>What you need to do is create two false list of records, once you have them, you can spit them out how ever you want (to a csv file, to excel, to ms access). CAVEAT: The recordSets must be sorted by the primary key to work.</p> <p>This code steps through both recordsets in order, creating ordered lists with either blanks or links to a record (While it looks very like VB code, consider this to be pseudo code, the logic is correct, it will not compile)</p> <pre><code>Dim rs1 As Recordset Dim rs2 As Recordset Dim rs1List As Collection Dim rs2List As Collection REM code here to initialise the collections to new Collection and fill the record sets Do While Not rs1.EOF And Not rs2.EOF If rs1("PKey") = rs2("PKey") Then rs1List.Add rs1.Bookmark rs2List.Add rs2.Bookmark rs1.Movenext rs2.Movenext ElseIf rs1("PKey") &lt; rs2("PKey") Then rs1List.Add rs1.Bookmark rs2List.Add Nothing rs1.Movenext ElseIf rs1("PKey") &gt; rs2("PKey") Then rs1List.Add Nothing rs2List.Add rs2.Bookmark rs2.Movenext End If Loop Do While Not rs2.EOF rs1List.Add Nothing rs2List.Add rs2.Bookmark rs2.Movenext Loop Do While Not rs1.EOF rs1List.Add rs1.Bookmark rs2List.Add Nothing rs1.Movenext Loop </code></pre> <p>Assumes the primary key field is PKey, and that .Bookmark is a method you can use to go directly to that record (ordinal position might do if available).</p> <p>Hope this helps</p> <p><strong>Edit</strong></p> <p>Just changed some bits in the last two loops, they weren't quite right.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload