从 Interbase Knowlegde base 得来的.<br><br><br>Step 1:<br><br>Connect to ISC4 and grant update to public on the USERS table<br><br><br>Step 2:<br><br>Create a before update trigger to ensure that users are only changing their own information<br><br>Step 3:<br><br>In your application use the following code:<br><br>=========================================<br>implementation<br><br>{$R *.DFM}<br><br>uses<br> IBHeader, IBExternals;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> Sec_data: TUserSecData;<br> IBLibrary: THandle;<br> isc_modify_user: Tisc_modify_user;<br> StatusVec: array[0..20] of ISC_STATUS;<br>begin<br><br> { Clear out the structure }<br> FillChar (Sec_data, sizeof (Sec_Data), 0);<br><br> {Setup the flags. Since I am using TCPIP, I need to set sec_server_spec }<br> Sec_data.sec_flags := (sec_password_spec or sec_server_spec);<br> Sec_data.protocol := sec_protocol_tcpip;<br><br> { Add the servername, password, and username }<br> Sec_data.server := 'localhost';<br> Sec_data.password := 'abcde';<br> Sec_data.user_name := 'test_user';<br><br> try<br> { Load the client library }<br> IBLibrary := LoadLibrary ('gds32.dll');<br> try<br> { Lookup the address of the function }<br> isc_modify_user := GetProcAddress (IBLibrary, 'isc_modify_user');<br><br> { Call isc_modify_user with the proper parameters }<br> isc_modify_user (@StatusVec, @Sec_data);<br><br> { Check for errors }<br> if StatusVec[1] <> 0 then<br> Raise Exception.Create('Password not modified')<br> else<br> ShowMessage ('Password Updated');<br> except<br> on E: Exception do<br> ShowMessage (E.Message);<br> end;<br> finally<br> FreeLibrary (IBLibrary);<br> end;<br>end;<br>=========================================<br>