有没有办法编程增加 Interbase 数据库的用户,或修改已存在用户的密码?(100分)

  • 主题发起人 主题发起人 xihahi
  • 开始时间 开始时间
use IB server manager, then connect your database, right click on it,<br>---user security
 
下栽 freeudflib 有这个功能
 
去哪下载?
 
hehe。看错题目了<br>你可以写c:/program files/interbase corp/interbase/isc4.gdb中的users<br>表,insert就可以了。
 
可以用grant赋权限
 
同意yifeng 使用InterBase server manager的User security菜单
 
编程的话:<br><br>1、运行行命令: interbase/bin/gsec.exe .......(很多参数)<br>2、去interbase主页下载自定义函数库 freeudflib , 安装后可以通过函数方式<br>管理用户
 
从 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>&nbsp; IBHeader, IBExternals;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; Sec_data: TUserSecData;<br>&nbsp; IBLibrary: THandle;<br>&nbsp; isc_modify_user: Tisc_modify_user;<br>&nbsp; StatusVec: array[0..20] of ISC_STATUS;<br>begin<br><br>&nbsp; { Clear out the structure }<br>&nbsp; FillChar (Sec_data, sizeof (Sec_Data), 0);<br><br>&nbsp; {Setup the flags. &nbsp;Since I am using TCPIP, I need to set sec_server_spec }<br>&nbsp; Sec_data.sec_flags := (sec_password_spec or sec_server_spec);<br>&nbsp; Sec_data.protocol := sec_protocol_tcpip;<br><br>&nbsp; { Add the servername, password, and username }<br>&nbsp; Sec_data.server := 'localhost';<br>&nbsp; Sec_data.password := 'abcde';<br>&nbsp; Sec_data.user_name := 'test_user';<br><br>&nbsp; try<br>&nbsp; &nbsp; { Load the client library }<br>&nbsp; &nbsp; IBLibrary := LoadLibrary ('gds32.dll');<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; { Lookup the address of the function }<br>&nbsp; &nbsp; &nbsp; isc_modify_user := GetProcAddress (IBLibrary, 'isc_modify_user');<br><br>&nbsp; &nbsp; &nbsp; { Call isc_modify_user with the proper parameters }<br>&nbsp; &nbsp; &nbsp; isc_modify_user (@StatusVec, @Sec_data);<br><br>&nbsp; &nbsp; &nbsp; { Check for errors }<br>&nbsp; &nbsp; &nbsp; if StatusVec[1] &lt;&gt; 0 then<br>&nbsp; &nbsp; &nbsp; &nbsp; Raise Exception.Create('Password not modified')<br>&nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; ShowMessage ('Password Updated');<br>&nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; on E: Exception do<br>&nbsp; &nbsp; &nbsp; &nbsp; ShowMessage (E.Message);<br>&nbsp; &nbsp; end;<br>&nbsp; finally<br>&nbsp; &nbsp; FreeLibrary (IBLibrary);<br>&nbsp; end;<br>end;<br>=========================================<br>
 
我也有同样的问题, 不知道客户端如何修改自己的interbase 帐户密码<br>如果如 weisian 所说的话, 那么, 在客户端就得建立另一个 database 联接,<br>指向系统的用户数据库, 是不是这样呢?<br>另外, weisian 所说的 interbase knowledge base 在哪里可以找到? 在 delphi 4 自带的文件中好象没有
 
......在客户端就得建立另一个 database 联接,<br>指向系统的用户数据库, 是不是这样呢?<br>&nbsp; 用这个例子,应该要那么做. &nbsp;另一方法可参考<br>http://www.interbase.com/downloads/sqlroles.pdf . 不过必须把<br>SYSDBA 与 password 加入程序中.<br><br>.....interbase knowledge base <br>只能到http://www.interbase.com/open/research/knowledgebase.html<br>里找吧.<br>
 
isc_add_user( )<br>&nbsp; Adds a user record to the password database<br>isc_delete_user( )<br>&nbsp; Deletes a user record from the password database<br>isc_modifiy_user( )<br>&nbsp; Modifies a user record in the password database
 
多人接受答案了。
 
后退
顶部