Re: Have any one tried Crystal Reports w
Posted in 1997
Topics: Security, Permissions & Auditing, Data Types & Schema Design
> There is the bug in the function CRPEngine::LogOnServer(). The main point is that the data types CHAR(m) and CHAR(*) are stored differently in the memory. The type CHAR(*) is zero terminated string (C compatible) and CHAR(m) is char buffer with the 2 byte prefix (number of bytes in the buffer). So the type CHAR(*) must be used instead of CHAR(m) in the lstrcpy function. FUNCTION CRPEngine::LogOnServer(dllName CHAR(*), logOnInfo CRPELogOnInfo)RETURNING BOOLEAN VARIABLE returnCode BOOLEAN VARIABLE serverName CHAR(*) VARIABLE databaseName CHAR(*) VARIABLE userId CHAR(*) VARIABLE password CHAR(*) IF logOnInfo IS NULL THEN LET returnCode = FALSE GOTO exit_function END IF LET servername = logOnInfo.m_serverName CLIPPED LET databasename = logOnInfo.m_databaseName CLIPPED LET userid = logOnInfo.m_userID CLIPPED LET password = logOnInfo.m_password CLIPPED BEGIN_C { struct PELogOnInfo logOnInfo; logOnInfo.StructSize = sizeof(struct PELogOnInfo); lstrcpy(logOnInfo.ServerName, servername); lstrcpy(logOnInfo.DatabaseName, databasename); lstrcpy(logOnInfo.UserID, userid); lstrcpy(logOnInfo.Password, password); returncode = PELogOnServer(dllname,&logOnInfo); } END_C LABEL exit_function: RETURN returnCode END FUNCTION This fixed function I use in my class library and it works fine.