Many thanks Timur, that worked a charm. It's a shame I could find no mention
to this in the official Cache Docs.....


"Timur Safin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> You definitely need to call this mentioned EncryptPswd function from
> CMVISM32.DLL. Do something like that in Delphi:
>
> uses
>   CacheObject;
>
> function EncryptPswd(lpszPassword: PChar; lpszEncrypt) : integer stdcall;
> external 'cmvism32.dll' name 'EncryptPswd';
> ...
> var
>
>  Cache : IFactory;
>  encPassword, userName: String;
>  res : integer;
>
> begin
>   SetLength(encPassword, 8);
>   userName := 'YourUserName';
>   res := EncryptPswd('MyPassword',PChar(encPassword));
>   ShowMessage('This is the encrypted password: ' + encpwd);
>   Cache := IFactory.Create;
>   if Not Cache.Connect('cn_iptcp:127.0.0.1[1972]:USER:" + username + ':' +
> encpwd) ) Then
>   blah-blah-blah
>
> I didn't compile this code though...
>
> Best Regards,
> Timur
>
> P.S.
> It is your responsibility to make sure this cmvism32.dll will be
accessible at
> the moment application would  run.
>
>
> Tim Ireland" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> : Does anyone know how I get this to work via Delphi?
> :
> : Cannot figure how I pass username and password. Have tried including
these
> : in connectstring but still get logon dialogue. Do I need to call the
encrypt
> : function from CMVISM32.dll, if so how?
> :
> :
> : "Alexandra Schaefer" <[EMAIL PROTECTED]> wrote in message
> : news:[EMAIL PROTECTED]
> : > Michal,
> : >
> : > The code below can only be used for Cache 5 factory connection. Here
is a
> : VB
> : > sample that encrypts the password and does the factory connection.
> : >   Declare Function EncryptPswd Lib "c:\cache419\bin\CMVISM32.DLL"
(ByVal
> : > pswd$, ByVal encript$) As Integer
> : >   ....
> : >   Dim Cache As New CacheObject.Factory
> : >   Dim encpwd As String 'Encripted Password
> : >   Dim res, username
> : >       encpwd = Space(8) 'allocate string
> : >       username = "MyUserName"
> : >       res = EncryptPswd("MyPassword", encpwd)
> : >       MsgBox ("This is the encrypted password: " + encpwd)
> : >       If Not Cache.Connect("cn_iptcp:127.0.0.1[1972]:USER:" & username
&
> : ":"
> : > & encpwd) Then
> : >          MsgBox "Error connecting to Cach� "
> : >       Else
> : >          MsgBox "Connection OK"
> : >       End If
> : >   ....
> : > Hope that helps,
> : > Alex
> : >
> : > "Bill McCormick" <[EMAIL PROTECTED]> wrote in message
> : > news:[EMAIL PROTECTED]
> : > > Only in version 5
> : > >
> : > > Michal Banat wrote:
> : > >
> : > > > Hello,
> : > > > I am really new in Cache. I try to use ActiveX factory
> : > > > to access Cache objects.
> : > > >
> : > > > I'm doing it in this way
> : > > > factory = CreateObject("CacheObject.Factory")
> : > > >
> : > > > If Not factory.IsConnected Then
> : > > >
> : > > > factory.Connect("cn_iptcp:127.0.0.1[1972]:NAM")
> : > > >
> : > > > End If
> : > > >
> : > > > I want to know if it is possible to specify username and password
for
> : > the
> : > > > connection in connection string or somewhere else.
> : > > >
> : > > > I must NOT have the cache login screen.
> : > > >
> : > > > Thanks,
> : > > > Michal Banat
> : > > > PS. Versions: Cache 4.1,VB .NET
> : > > >
> : > > >
> : > >
> : > >
> : > > --
> : > > Bill McCormick
> : > > Web/Objects Support Manager
> : > > InterSystems Corporation
> : > > [EMAIL PROTECTED]
> : > >
> : >
> : >
> :
> :
>
>



Reply via email to