Wing Posted February 19, 2012 Author Share Posted February 19, 2012 Hello!I was wondering how would I get it to check a mysql database for a valid username and password, and if valid and matching it would then create the account files in the server.Basically I want to get rid of Origins registering system, and have them login with MySQL database information. If its a new account a file will be created to remember the account, and will be sent to character creation screen. Link to comment Share on other sites More sharing options...
The New World Posted February 19, 2012 Share Posted February 19, 2012 Well for one you'll need to learn how to use ADO.From there you should find it obvious if your skills are well enough. Link to comment Share on other sites More sharing options...
Wing Posted February 19, 2012 Author Share Posted February 19, 2012 @[rose:> link=topic=78286.msg839408#msg839408 date=1329611963]> Well for one you'll need to learn how to use ADO.> > From there you should find it obvious if your skills are well enough.Thanks! Will this be able to connect to a remote MySQL database? Link to comment Share on other sites More sharing options...
evilbunnie Posted February 19, 2012 Share Posted February 19, 2012 @♥:> Thanks! Will this be able to connect to a remote MySQL database?Yes. Link to comment Share on other sites More sharing options...
Lenton Posted February 19, 2012 Share Posted February 19, 2012 So many people ask how to do this. Link to comment Share on other sites More sharing options...
Wing Posted February 19, 2012 Author Share Posted February 19, 2012 @Lenton:> So many people ask how to do this.Actually, I searched the word Database beforehand. I didn't find anyone asking the same question I had. Link to comment Share on other sites More sharing options...
crzyone9584 Posted February 19, 2012 Share Posted February 19, 2012 Here is how I'm doing it so far.```Dim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetPrivate Sub MysqlLogin(ByVal username As String, ByVal password As String) Set cn = New ADODB.Connection cn.ConnectionString = ConnectString() Dim sql As String Set rs = New ADODB.Recordset sql = "select Count(uid) from _users where username = '" & username & "' AND password = '" & password & "';" rs.Open sql, cn, adOpenDynamic, adLockReadOnly If rs(0) = 1 Then ' login okay send character selection screen Else ' login not okay End IfEnd SubPrivate Function ConnectString() As String Dim ServerName As String Dim DatabaseName As String Dim username As String Dim password As String ' change to IP if not on local machine ' Make sure that you give permission to log into the ' server from this address ' See Adding New User Accounts to MySQL ' Make sure that you d/l and install the MySQL Connector/ODBC 3.51 Driver ServerName = "localhost" DatabaseName = "test" username = "test" password = "test" ConnectString = "DRIVER={MySQL ODBC 3.51 Driver};" & _ "SERVER=" & ServerName & _ ";DATABASE=" & DatabaseName & ";" & _ "USER=" & username & _ ";PASSWORD=" & password & _ ";OPTION=3;"End Function```I just need to figure out how to pull the salt from the db and add it to the password before it checks for the password… Hope this helps. Btw this will be different for you. I'm working with MyBB forum software. Link to comment Share on other sites More sharing options...
Robin Posted February 19, 2012 Share Posted February 19, 2012 I highly suggest not doing anything like that at all. Remote querying is delayed and unthreaded. This will make your server perform like me trying to drive with a broken ankle. It'll be like a rabbit staggering along every so often.Either learn how to do background tasks in VB6 or do what I did and create an authentication server. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now