Newbie Spellweaver
- Joined
- Dec 19, 2021
- Messages
- 77
- Reaction score
- 37
SORRY FORGOT TO ADD .CPP FILE OF DB
I added the things i forgot, including the update in ODBCStatement.CPP
i am sorry if anyone has tried it and it failed
Are you tried of "WRONG DB PASSWORD" ERROR no matter what you do?
here is the things you can do to fix it (I am using 4.6 Source)
in ODBCStatement.h
in ODBCStatement.CPP
right into here:
in PreIOCP.cpp
if an Error happens should give error in PreServer log like :
View attachment 297015 <<- Attachment Broke sorry
I added the things i forgot, including the update in .cpp
i am sorry if anyone has tried it and it failed
Unless i forgot something else
this should work
I added the things i forgot, including the update in ODBCStatement.CPP
i am sorry if anyone has tried it and it failed
Are you tried of "WRONG DB PASSWORD" ERROR no matter what you do?
here is the things you can do to fix it (I am using 4.6 Source)
in ODBCStatement.h
C++:
// Error information accessors
const char* GetLastSqlState_RAT() { return m_szLastSqlState; }
int GetLastNativeError_RAT() { return m_nLastNativeError; }
const char* GetLastErrorMsg_RAT() { return m_szLastErrorMsg; }
public:
SQLHENV m_henv;
SQLHDBC m_hdbc;
SQLHSTMT m_hstmt;
mt_lock m_lock;
private:
char m_szLastSqlState[MAXDBMSGBUFLEN];
int m_nLastNativeError;
char m_szLastErrorMsg[MAXDBMSGBUFLEN];
in ODBCStatement.CPP
C++:
// Store the last error information
strcpy_s(m_szLastSqlState, MAXDBMSGBUFLEN, (const char*)plm_szSqlState);
m_nLastNativeError = (int)plm_pfNativeError;
strcpy_s(m_szLastErrorMsg, MAXDBMSGBUFLEN, (const char*)plm_szErrorMsg);
in PreIOCP.cpp
C++:
BOOL bRet = odbcStmt.Init(
g_pGlobalGameServer->GetDBServerIP(),
g_pGlobalGameServer->GetDBServerPort(),
g_pGlobalGameServer->GetDBServerDatabaseName(),
(char*)g_pGlobalGameServer->GetODBCUID(),
(char*)g_pGlobalGameServer->GetODBCPASSWORD(),
g_pGlobalGameServer->GetMainWndHandle()
);
if (!bRet)
{
g_pGlobal->WriteSystemLogEX(
TRUE,
"[DB Error] DBServer connection failed!\n"
"IP:%s, Port:%d, DB:%s, UID:%s\n"
"SQLSTATE:%s, NativeError:%d\n"
"Message:%s\n",
g_pGlobalGameServer->GetDBServerIP(),
g_pGlobalGameServer->GetDBServerPort(),
g_pGlobalGameServer->GetDBServerDatabaseName(),
(char*)g_pGlobalGameServer->GetODBCUID(),
odbcStmt.GetLastSqlState_RAT(),
odbcStmt.GetLastNativeError_RAT(),
odbcStmt.GetLastErrorMsg_RAT()
);
MessageBox(NULL, "DB connect CPreIOCP::IOCPInit()", "ERROR - SpaceCowboy PreServer", NULL);
return FALSE;
}
if an Error happens should give error in PreServer log like :
View attachment 297015 <<- Attachment Broke sorry
I added the things i forgot, including the update in .cpp
i am sorry if anyone has tried it and it failed
Unless i forgot something else
this should work

