I used access+sql2000. It will be appear to administer the code, (It does not support ‘”index”interface function ,)please give the directions.
Private Sub ctExplorer1_lbItemClick(ByVal nList As Integer, ByVal nItem As Integer)
On Error GoTo TC_Err
Dim func As String, mdl As String
With ctExplorer1
//when we clicked, The corresponding function will be opend automatically,and it has been already saved in the project in the ilbem cargo attribute.
If Not IsNull(ctExplorer1.lbItemCargo(nList, nItem)) Then
mdl = ctExplorer1.lbItemCargo(nList, nItem)
// calls the open cmd to open the corresponding function (function of the form or repor)
OpenCmd mdl
Exit Sub
End If
End With
Exit Sub
TC_Err:
glMessageBox "mistake:" & Err.Description
Exit Sub
End Sub
//According to the parameters,open corresponding the form or function or report.
Public Sub OpenCmd(mdl As String)
On Error GoTo OC_Err
Dim rs As New ADODB.Recordset
Dim conn As New ADODB.Connection
Dim func As String
Dim strsql As String
Set conn = CurrentProject.Connection
strsql = "select * from tblProgItem"
rs.Open strsql, conn, adOpenStatic, adLockReadOnly
rs.Index = "ModuleID"
rs.Seek "=", mdl
If DCount("func", "tblSysRightUserRight", "uname='" & LogUser & "' and func='" & mdl & "'") = 0 Then
glMessageBox "You do not have permission to use this function !"
Exit Sub
End If
Exit Sub
OC_Err:
glMessageBox "tellme" & Err.Description
Exit Sub
End Sub