Re: implement MD5 Hash error

  • Hi,

    I'm trying to use extended stored procedure for SQL Server to implement MD5 Hash algorithm but I rec'd the following error when I execute sp via VBA.

    MS VB:

    Run-time error ‘-2147217900(80040e14)’:

     

    Cannot load the DLL c:\Program Files\Microsoft SQL Server\MSSQL\Binn, or one of the DLLs it references. Reason: 126(The specified module could not be found.).

     

    With get_results

        .ActiveConnection = CurrentProject.Connection

        .CommandText = "spGet_hash_results"

        .CommandType = adCmdStoredProc

        .Parameters.Append .CreateParameter("ret_val", adInteger, adParamReturnValue)

        .Parameters.Append .CreateParameter("@hash", adChar, adParamOutput, 32)

            .Execute , , adExecuteNoRecords  <-- error occurred here

       

    End With

    Would anyone know where I should find the error(s)

    Thanks for your assistance.

  • I don't think the VBA code is the issue:

    >>Cannot load the DLL c:\Program Files\Microsoft SQL Server\MSSQL\Binn

    This error would seem to indicate a badly constructed filename in the extended stored proc - I'd expect a filename to be here, not a folder name.

  • Thanks for your reply.

    I changed path in the extended stored proc it's still giving me the error.

    "Cannot load the DLL xp_md5.dll, or one of the DLLs it references. Reason: 126(The specified module could not be found.)."

     

    Do I need to add

    USE master;

    EXEC sp_addextendedproc 'xp_md5', 'xp_md5.dll'

     

    if so would that be extended stored proc in Master database?

     

    Thanks!

     

  • I'm having the exact same problem, so I would be curious if you found a resolution.

    I got the code for the DLL from http://www.codeproject.com/database/xp_md5.asp?df=100&forumid=32460&select=1050105#xx938204xx

    built the DLL and deployed per the instructions, and yet I get the same error.

    Any tips are much appreciated!  Thanks in advance!

    Bill

  • Hi Bill,

    No, I ended up creating a stored procedure and UDF to encrypt and decrypt the password from a post I found.  This is what I'm using:

    \\\\\\\\\\\\\\\\\\

    CREATE PROCEDURE dbo.sp_T

                    @initials char(3),

                    @PlainText varchar(8000),

                    @CryptoText varchar(8000) output, -- Encrypted text

                          @Decrypted varchar(8000) output

    AS

    select @cryptotext = passwd from tblPassword where initials = @initials

    SELECT @Decrypted = dbo.ufn_rot13redux(@Cryptotext)

    GO

     

    \\\\\\\\\\\\\\\\\\\\

     

    create function ufn_Rot13Redux (@input varchar(8000))

     returns varchar(8000)

    as

    begin

     declare @pass varchar(8000)

     

     set @pass = ''

     select

      @pass = @pass +

          CASE

          WHEN ASCII(SUBSTRING(@input,n.number+1,1)) BETWEEN 97 AND 122

           THEN CASE WHEN ASCII(SUBSTRING(@input,n.number+1,1)) - 13 < 97

                     THEN char((ASCII(SUBSTRING(@input,n.number+1,1)) - 13)

                                                  + 122 - 96)

             ELSE char(ASCII(SUBSTRING(@input,n.number+1,1)) - 13) END

          WHEN ASCII(SUBSTRING(@input,n.number+1,1)) BETWEEN 65 AND 90

           THEN CASE WHEN ASCII(SUBSTRING(@input,n.number+1,1)) - 13 < 65

                     THEN char((ASCII(SUBSTRING(@input,n.number+1,1)) - 13)

                                                        + 90 - 64)

             ELSE char(ASCII(SUBSTRING(@input,n.number+1,1)) - 13) END

          ELSE CHAR(ASCII(SUBSTRING(@input,n.number+1,1)))

          END

     from

      numbers n

     where

      n.number < len(@input)

     

    Hope this helps you.

    Good Luck!

     

     

  • In order to get this running you need to execute sp_addextendedproc with this DLL. Otherwise SQL Server doesn't know how to handle it. And yes, it will be then an extended proc in master (AFAIK, the only place where XP

    's reside). See if this helps:

    http://www.support.microsoft.com/?scid=kb;en-us;190987

    http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322884

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply