Connecting Tech Pros Worldwide Help | Site Map

convert as below code to vb.net

Kosal's Avatar
Member
 
Join Date: Feb 2007
Location: Phnom Penh
Posts: 58
#1: Aug 6 '08
Dear All

Can you help me to convert as below code to vb.net module

Expand|Select|Wrap|Line Numbers
  1. Function GF_ListGroupsOfUser(ByVal stUserName As String) As String
  2.         On Error GoTo err_ListGroupsOfUser
  3.         Dim cnn As ADODB.Connection
  4.         Dim Rst As New ADODB.Recordset
  5.         Dim st As String
  6.  
  7.         cnn = CurrentProject.Connection
  8.  
  9.         st = "SELECT g.guName FROM tblGroupUser AS g INNER JOIN tblGroupUser AS u ON g.guID = u.guGroupID " & _
  10.              "WHERE u.guLevel = 2 AND u.guName = " & Chr(34) & stUserName & Chr(34)
  11.         Rst.Open(st, cnn, adOpenKeyset, adLockOptimistic)
  12.         If Rst.RecordCount > 0 Then
  13.             GF_ListGroupsOfUser = Trim$(Rst(0))
  14.         End If
  15.  
  16. Err_Exit:
  17.         Rst = Nothing
  18.         cnn = Nothing
  19.         Exit Function
  20.  
  21. err_ListGroupsOfUser:
  22.         MsgBox(Err.Description)
  23.         Resume Err_Exit
  24.     End Function
thanks
Best Regard
kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#2: Aug 6 '08

re: convert as below code to vb.net


Suggest that you find a converter...
Kosal's Avatar
Member
 
Join Date: Feb 2007
Location: Phnom Penh
Posts: 58
#3: Sep 8 '08

re: convert as below code to vb.net


Quote:

Originally Posted by kenobewan

Suggest that you find a converter...

Ok sir

Thanks
Best Regard
Reply