• Welcome to Valhalla Legends Archive.
 

Database Problems

Started by LizArD, March 03, 2004, 03:12 PM

Previous topic - Next topic

LizArD

I did not make this source, it was given to me by Voodoo[Fa], this is just the database part of it. He wont help me so I turn to these forums  Anyway, when I add someone with any flag it seems to add fine of course, then when I reload the bot, it says "Error in database" I don't know what information you need to help me, so I just pasted the whole source for database.. Any help be great =]

Public Sub LoadDB()
   On Error Resume Next
   Dim Change As Boolean
   Dim Splt() As String
   Dim Tempa As al
   'username, rank, flags, date, time, addedby
   Open "Database.txt" For Input As #1
   Do Until EOF(1)
   Line Input #1, Item
   If Item <> "" Then
   Splt() = Split(Item, " ")
   If UBound(Splt) > 3 Or UBound(Splt) < 3 Then
       MsgBox "Error loading database", vbCritical, "Error"
       End
   End If
   If Splt(1) >= 101 Or Splt(1) < 0 Then
       MsgBox "Error loading database", vbCritical, "Error"
       End
   End If
   If UCase(Splt(2)) <> "NO" And UCase(Splt(2)) <> "S" And UCase(Splt(2)) <> "B" And UCase(Splt(2)) <> "K" Then
       MsgBox "Error loading database", vbCritical, "Error"
       End
   End If
   If Splt(1) > 0 And UCase(Splt(2)) <> "NO" Then
       MsgBox "Error loading database", vbCritical, "Error"
       End
   End If
   If UCase(Splt(6)) <> "NONE" Then
       Tempa.BMessage = Splt(3)
   Else
       Tempa.BMessage = "None"
   End If
   Tempa.Rank = Splt(1)
   Tempa.Flags = UCase(Splt(2))
   Tempa.Username = Splt(0)
   AddAccess Tempa
   End If
Ending69:
   Loop
   Close #1
   SaveAccessList
End Sub

Grok

Hi.  Welcome to our forums.  We request that when you paste code, use the code tags to make it easier to read.  Put these tags:  [ code ] and [ /code ] with the spaces removed, around your source code.

drivehappy

#2
It's occuring when one or several of these conditions are true:


   If UBound(Splt) > 3 Or UBound(Splt) < 3 Then
       MsgBox "Error loading database", vbCritical, "Error"
       End
   End If
   If Splt(1) >= 101 Or Splt(1) < 0 Then
       MsgBox "Error loading database", vbCritical, "Error"
       End
   End If
   If UCase(Splt(2)) <> "NO" And UCase(Splt(2)) <> "S" And UCase(Splt(2)) <> "B" And UCase(Splt(2)) <> "K" Then
       MsgBox "Error loading database", vbCritical, "Error"
       End
   End If
   If Splt(1) > 0 And UCase(Splt(2)) <> "NO" Then
       MsgBox "Error loading database", vbCritical, "Error"
       End
   End If


Find out which one and trace through your save file.

LizArD

Thx guys, Kp helped on other forum *whoops* Ty anyway.