Results 1 to 9 of 9

Thread: Insert Into

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    499

    Resolved Insert Into

    i use this to grab the fields from my database but how do you add a new row using the INSERT INTO.
    VB Code:
    1. Set rec = New Recordset
    2.  
    3. rec.Open "SELECT * FROM Tdetails", con, adOpenKeyset, adLockOptimistic
    4.  
    5.  Do While Not rec.EOF
    6.   Set itm = lv.ListItems.Add(, , rec.Fields(0))
    7.    itm.SubItems(1) = rec.Fields(1)
    8.    itm.SubItems(2) = rec.Fields(2)
    9.    itm.SubItems(3) = rec.Fields(3)
    10.    itm.SubItems(4) = rec.Fields(4)
    11.    itm.SubItems(5) = rec.Fields(5)
    12.   rec.MoveNext
    13.  Loop
    14.  
    15. rec.Close
    16. Set rec = Nothing

    thanks.
    Last edited by user name; May 19th, 2005 at 03:43 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width