And "CheckUsrBan" function:VB Code:
Dim strString5 As String Winsock1(Index).GetData strString5 If Not CheckUsrBan(strString5) Then Winsock1(Index).SendData "blahno" ElseIf CheckUsrBan(strString5) Then Winsock1(Index).SendData "blahyes" End If
Anyone see a reason why either of those would error "Subscript out of range" ?VB Code:
Private Function CheckUsrBan(ByVal pstruser As String) As Boolean Open_dbcon Set cmdCommand = New ADODB.Command With cmdCommand Set .ActiveConnection = dbcon .CommandType = adCmdText .CommandText = "SELECT COUNT(*) AS Total FROM roguespear_ban WHERE user = '" & pstruser & "' " Set adoRec = .Execute CheckUsrBan = (adoRec.Fields.Item("Total").Value > 0) Set adoRec = Nothing End With Set cmdCommand = Nothing Close_dbcon End Function




Reply With Quote