Stuck on row one when populating a table from data

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I thought that this was pretty straightforward code but I cannot get
off of row one.

When I execute this bit I end up with a table with one row of data and
it is the last row from the dataset pulled. It overwrites the header
row and every other recordset of information that the SQL statement
pulls. If I take the loop out, I get just the first row of data as you
would expect. There are no errors. Just poor results LOL.

Can someone spot why I am not getting additional rows? There should be
4 including the header.

With vRecordSet
If Not .EOF Then

.MoveFirst
rowcount = 1
Set objTable = ActiveDocument.Tables(1)
objTable.Cell(rowcount, 1).Range.Text = "Resolution #"
objTable.Cell(rowcount, 2).Range.Text = "Topic"
objTable.Cell(rowcount, 3).Range.Text = "Department"

Do While Not .EOF

rowcount = rowcount + 1
vResolutionNumber = vRecordSet("resolutionNumber")
vTopic = vRecordSet("topic")
vDepartment = vRecordSet("department")

objTable.Cell(rowcount, 1).Range.Text =
vResolutionNumber
objTable.Cell(rowcount, 2).Range.Text = vTopic
objTable.Cell(rowcount, 3).Range.Text = vDepartment

'Go to next record, exit after last
vRecordSet.MoveNext
Loop

Set objTable = Nothing

Else
'if you ARE *else* (are .EOF), that means no record was
matched, tell the user
MsgBox "No possible match was found."
End If

End With

********************************************************
I have tried a number of ways to insert rows but the following code
which seems like it should work, claims that part or all of the 2nd
line is not in reference to a table.

objTable.Rows(rowcount).Select
Selection.InsertRowsBelow

.



Relevant Pages

  • Re: reading data using F mode in rexx
    ... IF ooRexxInstalled=0 THEN Download() ELSE Execute ... IF ooRexxInstalled=0 THEN Exit ELSE Execute() ... // End Header ... Is the interpreter installed, it ...
    (comp.lang.rexx)
  • Re: Stuck on row one when populating a table from data
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... > 4 including the header. ... > With vRecordSet ... > vResolutionNumber ...
    (microsoft.public.word.vba.general)
  • Re: validating problem
    ... > I have got a problem where i have to execute ... >a portion of code only when a header file is ... You do realize that a header is included when your program is ... having a header file define an object or contain executable code. ...
    (comp.lang.c)
  • Re: Execute Stream?
    ... is possible to load exe File in TFileStream and execute it? ... > I need this for preview purpouses.. ... > the second file is a data file that is attached before header. ...
    (alt.comp.lang.borland-delphi)
  • [Full-disclosure] Small Linux Kernel Patch To Check For Shdr
    ... This small patch can be applied to the Linux kernel ... section header off of an ELF executable. ... even execute such binaries. ...
    (Full-Disclosure)