Have a program developen in OE 11.7. Reading and updateing a MsSql database for ABL using .Net components. Trying to run it under OE10.2b and get an error message:.
Invalid datatype specified SqlCredentials. Spesify a datatype ...(5638).
How can i do this in OE 10.2b?
In the definition block:
------------------------------
USING Progress.Lang.*.
USING System.Data.*.
USING System.Data.SqlClient.*.
DEFINE VARIABLE SqlCred AS SqlCredential NO-UNDO.
And the method using the variable.
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
METHOD PUBLIC LOGICAL oppkoblingSqlServer( ):
DEFINE VARIABLE result AS LOGICAL NO-UNDO.
result = FALSE.
/* passord -> sec.string */
SeqString = NEW System.Security.SecureString().
DO ix = 1 TO LENGTH(cPwd):
SeqString:AppendChar(SUBSTR(cPwd,ix,1)).
END.
SeqString:MakeReadOnly().
/* brukernavn, pwd */
SqlCred = NEW SqlCredential(cUserId,SeqString).
ConString = "Server=" + cServer + ",1433".
ConString = ConString + ";Database=" + cDbName .
Conn = NEW SqlConnection(ConString,SqlCred).
Conn:Open() NO-ERROR.
IF ERROR-STATUS:ERROR THEN
DO:
rStandardFunksjoner:SkrivTilLogg(cLogg,
' ' + ERROR-STATUS:GET-MESSAGE(1)
).
END.
ELSE
DO:
rStandardFunksjoner:SkrivTilLogg(cLogg,
' Oppkoblet mot Sql server: ' + ConString + '.'
).
result = TRUE.
END.
CmdRead = NEW SqlCommand('', Conn).
RETURN result.
END METHOD.
|