Ok, i got the database working but when I go to make an character, when I click create, it gives my server an error and highlights
If .FKey = 0 Then
.FKey = RS!FKey
End If
Whats wrong?
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
What error number do you get, and what does it say?
Ok, everything works fine. I log into my account, click create new character, enter a character name and choose my class, then when I click on create it gives me:
Compile Error:
Invalid or unqualified reference
And it highlights the .FKey in the If .FKey = 0 Then
Code: Sub AddChar(ByVal Index As Long, ByVal Name As String, ByVal Sex As Byte, ByVal ClassNum As Byte, ByVal CharNum As Long)
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
Dim I As Long
RS.Open "SELECT * FROM characters;", Conn_Client, adOpenStatic, adLockOptimistic
RS.AddNew
RS!Account = Player(Index).FKey
RS!Name = Trim$(Name)
RS!Sex = Sex
RS!Class = ClassNum
RS!Sprite = Class(ClassNum).Sprite
RS!Level = 1
RS!str = Class(ClassNum).str
RS!DEF = Class(ClassNum).DEF
RS!SPEED = Class(ClassNum).SPEED
RS!MAGI = Class(ClassNum).MAGI
RS!Map = 1
RS!X = 1
RS!Y = 1
RS!HP = 10
RS!MP = 10
RS!SP = 10
RS.Update
If .FKey = 0 Then
.FKey = RS!FKey
End If
RS.Close
Set RS = Nothing
End Sub
Dragoons Master
Unregistered
Replace:
If .FKey = 0 Then
.FKey = RS!FKey
End If
with:
If Player(Index).FKey = 0 Then
Player(Index).FKey = RS!FKey
End If
Hmm. I really don't understand much of the SQL related stuff in VB, but it looks like it should be in some sort of With
Dragoons Master Wrote:Replace:
If .FKey = 0 Then
.FKey = RS!FKey
End If
with:
If Player(Index).FKey = 0 Then
Player(Index).FKey = RS!FKey
End If
I did do that and it totally froze up my server..
Dragoons Master
Unregistered
Well, it fixed your error, but now you have a new one. Before you click on create account, go to the server and stop it then press F8, and then click on create account. You'll see that the server is running line by line, so you can press F8 a few times and make sure where the bug is, I mean the line...
Ok I would try this, but now it keeps saying "Access Denied" when I click on create char
Dragoons Master
Unregistered
You need to be an administrator to run a server... I think that's the problem.
You realy need to xD
Edit:
Btw, is this a system msg or an error or what?
Like it worked when I made a new account, its a msgbox error
Dragoons Master
Unregistered
There is no msg like "Access Denied" in vanila MSE... I don't know... I don't think this is a msgbox from MSE, it probably is a problem w/ your access level...
Well I dont know.. I downloaded 3.0.7 bcuz I would really love to use a database. I used that 3.0.7 installation guide which is stickied and then used his dump file which set up my database. Now, everything runs fine except creating a new character. I put in the Sub AddChar from the installation guide and it doesnt work.
Dragoons Master
Unregistered
Take a look at MySql user information, now that you said this, I think it is your MySql user that does not have the permissions to create a new record. Take a look at that!
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
Quote:I recommened using my sql dump. This will give you 5 maps, 5 shops, 5 items, 5 npcs, and 5 spells. Set your MAX_ variables to equal these (both client and server) and test out your 3.0.7 server.
Did you sett all MAX_ to 5?
Sorry, this is the sub that should've been posted (my bad) with my guide: Code: Sub AddChar(ByVal Index As Long, ByVal Name As String, ByVal Sex As Byte, ByVal ClassNum As Byte, ByVal CharNum As Long)
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
RS.Open "SELECT * FROM characters;", Conn_Client, adOpenStatic, adLockOptimistic
RS.AddNew
RS!Account = Player(Index).FKey
RS!Name = Trim(Name)
RS!Sex = Sex
RS!Class = ClassNum
RS!Sprite = Class(ClassNum).Sprite
RS!Level = 1
RS!str = Class(ClassNum).str
RS!DEF = Class(ClassNum).DEF
RS!SPEED = Class(ClassNum).SPEED
RS!MAGI = Class(ClassNum).MAGI
RS!Map = 1
RS!X = 1
RS!Y = 1
RS!HP = 10
RS!MP = 10
RS!SP = 10
RS.Update
If Player(Index).Char(CharNum).FKey = 0 Then
Player(Index).Char(CharNum).FKey = RS!FKey
End If
RS.Close
Set RS = Nothing
End Sub
Give that a try.
If that still doesn't work, you can just use my download link: http://www.talkanime.net/3.0.7/MS3.0.7v2.rar MS 3.0.7 which has all of the fixes/changes mentioned in my guide implemented.
William Wrote:Quote:I recommened using my sql dump. This will give you 5 maps, 5 shops, 5 items, 5 npcs, and 5 spells. Set your MAX_ variables to equal these (both client and server) and test out your 3.0.7 server.
Did you sett all MAX_ to 5? =P If he didn't change the MAX values, the server wouldn't start at all.
Ok cruzn, thx. I downloaded that one from your link and well, I set up the db and it worked. But now when I click on create character, it says connected and all that but the server totally freezes..
El_Dindonnier
Unregistered
Beres Wrote:Ok cruzn, thx. I downloaded that one from your link and well, I set up the db and it worked. But now when I click on create character, it says connected and all that but the server totally freezes..
I have the same problem, can I help me please ?
(thanks you in advance)
El_Dindonnier.
I actually got this working now.. What I did was just download the old 3.0.7, and did the installation guide.. EXCEPT, I didnt put in the AddChar sub. I left it as it was and well it connects and everything runs fine.
|