Click here to Skip to main content
14,934,103 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My Project is developed in Vb and Mysql. Now i got an error"Connection was Successfully established with the server,but then error occured during the login process"

My Db Connection Code is
Public Sub OpenDatabase(ByVal pblnOpen As Boolean)
        If GCon.State = ConnectionState.Open Then GCon.Close()
        GCon.ConnectionString = String.Format("Server={0};user id={1};password={2};database={3};Pooling=false", GstrServerName, GstrDBUser, GstrDBPass, GstrDBName)
        If pblnOpen Then GCon.Open()
    End Sub

What I have tried:

I tried many other but the error was not cleared
Updated 29-Aug-18 2:16am
Jochen Arndt 29-Aug-18 7:58am
Please show the relevant code lines. The error message looks like one generated by your application. So you should be able to locate the relevant code.

If so, you have already some kind of error check. Then get the error code and/or description too and append it to your error message string. Those contain much more details and help solving the problem.

Please use the green 'Improve question' link to add this information. Without that, it is impossible to help.
Jochen Arndt 29-Aug-18 8:23am
If the error occurs in the code from the updated question, use a try catch block around GCon.Open() and report the full exception message to get more details about what happened.

But because your message does not seem to be a system error message, it might also occur in code not shown yet.
[no name] 30-Aug-18 8:17am
Ok sir but the code was now working becoz by gods grace i'd another backup of my project so the error was now solved but i didn't know till now why the error was showed.I'd Compared my backup codes with the current codes there was no changes .Anyway thank you sir..

1 solution

Check the name and password you are passing using the debugger, and try "UID" and "PWD" instead of "user id" and "password" in your connection string.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900