Translate ADO Code From VB6 to VB.NET

Can someone translate this into a working VB.NET

Page 1 of 1

4 Replies - 2918 Views - Last Post: 29 November 2010 - 05:18 AM Rate Topic: -----

#1 kuraki  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-November 10

Translate ADO Code From VB6 to VB.NET

Posted 28 November 2010 - 09:26 PM

Set RS = New ADODB.Recordset
    sSQL = "SELECT courses.id AS courses_id, courses.title as courses_title, courses.description, "
    sSQL = sSQL & " courses.dept_id, users.id, users.name, dept.id, dept.title "
    sSQL = sSQL & " FROM courses "
    sSQL = sSQL & " LEFT OUTER JOIN users ON "
    sSQL = sSQL & " courses.user_id = users.id "
    sSQL = sSQL & " LEFT OUTER JOIN dept ON "
    sSQL = sSQL & " dept_id = dept.id "
    RS.Open sSQL, CN, 3, 4

    
    With lvw_CRS
        .ListItems.Clear
        .IconSize = 16
        .Icons.LoadIcon App.Path & "\ac_icons\folder.ico", 1, xtpImageNormal
   <----------------- how do i translate this to VB.NET Codes ------------------>
        While Not RS.EOF
            .ListItems.Add , , RS.Fields("courses_title"), 1
            .ListItems(.ListItems.Count).SubItems(1) = RS.Fields("description") & ""
            .ListItems(.ListItems.Count).SubItems(2) = RS.Fields("title") & ""
            .ListItems(.ListItems.Count).SubItems(3) = RS.Fields("name") & ""
            .ListItems(.ListItems.Count).SubItems(4) = RS.Fields("courses_id") & ""
            RS.MoveNext
        Wend
    End With


<------------------------------------------------------------------------------>
:helpsmilie:

This post has been edited by macosxnerd101: 28 November 2010 - 09:29 PM
Reason for edit:: Please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: Translate ADO Code From VB6 to VB.NET

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10396
  • View blog
  • Posts: 38,463
  • Joined: 27-December 08

Re: Translate ADO Code From VB6 to VB.NET

Posted 28 November 2010 - 09:29 PM

What problems or errors are you encountering? What is your question?
Was This Post Helpful? 0
  • +
  • -

#3 kuraki  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-November 10

Re: Translate ADO Code From VB6 to VB.NET

Posted 29 November 2010 - 04:15 AM

yes, it has errors in vb.net because i dont know how. i know vb6 has a different syntax and thats my big problem. ive searching google for quite a while and visited alot of forums but ive found no solution yet.

This post has been edited by kuraki: 29 November 2010 - 04:17 AM

Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,436
  • Joined: 23-August 08

Re: Translate ADO Code From VB6 to VB.NET

Posted 29 November 2010 - 05:09 AM

Please don't use topic titles like "Please Help!" We KNOW you need help, it's why you posted here! Use a title that describes the problem you're experiencing.

Changed title.
Was This Post Helpful? 0
  • +
  • -

#5 kuraki  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-November 10

Re: Translate ADO Code From VB6 to VB.NET

Posted 29 November 2010 - 05:18 AM

Thanks, but any ideas how can i fill a listview with a specific fields? actually the this program i wrote it in vb6 & mysql. i want to translate it to vb.net and mysql. but im having problems with this listview.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1