Valhalla Legends Forums Archive | Visual Basic Programming | Database Problems

AuthorMessageTime
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
March 3, 2004, 9:12 PM
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.
March 3, 2004, 9:29 PM
drivehappy
It's occuring when one or several of these conditions are true:

[code]
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
[/code]

Find out which one and trace through your save file.
March 3, 2004, 9:56 PM
LizArD
Thx guys, Kp helped on other forum *whoops* Ty anyway.
March 4, 2004, 12:49 AM

Search