谁肯拉小妹一把?(50分)

  • 主题发起人 主题发起人 冰雪
  • 开始时间 开始时间

冰雪

Unregistered / Unconfirmed
GUEST, unregistred user!
我是个新手,甚至不算手,请教大虾们几个问题,先谢了!
1、怎么样在设计时给PARADOX加上密码?
2、如何把PARADOX备分到A盘,一个的、盘装不下怎么办?代码该怎么写?
3、用户权限分配的思路怎样啊?
4、我有两个表,一个是出库的,一个是入库的,两个表都有日期、产品代码两个字段,
我要按照日期先后同时把两个表显示在一个表格里,也就是现在手工帐用的那种进销存明细
帐的效果,我该怎么做?请指导!!!!!
 
1.设计时加密?你用DataBase Desktop里头的吧
2.先计算大小,你所有文件你可以压成一个包再拷贝
3.建立用户权限表
4.你合并就行啊
 
推荐使用 ACCESS 数据库,把 问题1、2、3交给 ACCESS 工具来管理更合适
对问题4, 用SQL直接关联出库表和入库表,如果直接关联达不到效果,可以在ACCESS里分别建立出库和入库查询,然后用SQL关联这两个查询.
 
鉴于你的情况,推荐使用 ACCESS 数据库,把 问题1、2、3交给 ACCESS 工具来管理更合适
对问题4, 用SQL直接合并出库表和入库表,如果直接合并达不到效果,可以在ACCESS里分别建立出库和入库查询,
然后用SQL合并这两个查询.
 
鉴于你的情况,推荐使用 ACCESS 数据库,把 问题1、2、3交给 ACCESS 工具来管理更合适
对问题4, 用SQL直接合并出库表和入库表,如果直接合并达不到效果,可以在ACCESS里分别建立出库和入库查询,
然后用SQL合并这两个查询.
 
鉴于你的情况,推荐使用 ACCESS 数据库,把 问题1、2、3交给 ACCESS 工具来管理更合适
对问题4, 用SQL直接合并出库表和入库表,如果直接合并达不到效果,可以在ACCESS里分别建立出库和入库查询,
然后用SQL合并这两个查询.

都是流氓
 
听说现在 流氓兔 很火,作者是谁啊?
 
to aaa、haiping、karxios:
兄弟们凑什么热闹,你们得拿出真功夫来帮人家啊
 
这个需要面谈,哈哈。。。。

(纯属灌水) :)
 
我来回答你的第3个问题
我觉得你要在用户表中加一个标志位就已了,用来分配用户的权限。比如说用四个级
分别为1,2,3,4你来判断她就可以了
 
多谢楼上几层仁兄的指点,可我还是很笨,怎么样用SQL合并两个查询?能给点代码示例吗?
还有墙头草,你的意思是说先订好几个级别的权限,再设置操作员属于哪个级别,是吗?
但又怎样让用户自己设置级别的权限呢?用户-角色-权限的格式到底该怎么实现才是最佳的?
我曾想过根据用户的权限动态改变菜单的VISIBLE属性,但我有好多个表单,很多菜单项,
显然这个方法是很士很笨的,各位大侠们快帮帮手呀,小妹感激不尽,弄好了,我给你们
加分。当然不能以身相许!!!
 
呵呵。让人心里好痒,不过你得详明一点。
 
Working with password-protected Paradox and dBASE tables


A session component can store passwords for password-protected Paradox and dBASE tables. Once you add a password to the session, your application can open tables protected by that password. Once you remove the password from the session, your application can抰 open tables that use the password until you add it again.

Using the AddPassword method

The AddPassword method provides an optional way for an application to provide a password for a session prior to opening an encrypted Paradox or dBASE table that requires a password for access. If you do not add the password to the session, when your application attempts to open a password-protected table, a dialog box prompts the user for a password.
AddPassword takes one parameter, a string containing the password to use. You can call AddPassword as many times as necessary to add passwords (one at a time) to access tables protected with different passwords.

var

Passwrd: String;
begin
Passwrd := InputBox('Enter password', 'Password:', '');
Session.AddPassword(Passwrd);
try
Table1.Open;
except
ShowMessage('Could not open table!');
Application.Terminate;
end;
end;

Note: Use of the InputBox function, above, is for demonstration purposes. In a real-world application, use password entry facilities that mask the password as it is entered, such as the PasswordDialog function or a custom form.

The Add button of the PasswordDialog function dialog has the same effect as the AddPassword method.

if PasswordDialog(Session) then

Table1.Open
else
ShowMessage('No password given, could not open table!');
end;

Using the RemovePassword and RemoveAllPasswords methods

RemovePassword deletes a previously added password from memory. RemovePassword takes one parameter, a string containing the password to delete.

Session.RemovePassword('secret');

RemoveAllPasswords deletes all previously added passwords from memory.

Session.RemoveAllPasswords;

Using the GetPassword method and OnPassword event

The OnPassword event allows you to control how your application supplies passwords for Paradox and dBASE tables when they are required. Provide a handler for the OnPassword event if you want to override the default password handling behavior. If you do not provide a handler, Delphi presents a default dialog for entering a password and no special behavior is provided梩he table open attempt either succeeds or an exception is raised.

If you provide a handler for the OnPassword event, do two things in the event handler: call the AddPassword method and set the event handler抯 Continue parameter to True. The AddPassword method passes a string to the session to be used as a password for the table. The Continue parameter indicates to Delphi that no further password prompting need be done for this table open attempt. The default value for Continue is False, and so requires explicitly setting it to True. If Continue is False after the event handler has finished executing, an OnPassword event fires again梕ven if a valid password has been passed using AddPassword. If Continue is
True after execution of the event handler and the string passed with AddPassword is not the valid password, the table open attempt fails and an exception is raised.

OnPassword can be triggered by two circumstances. The first is an attempt to open a password-protected table (dBASE or Paradox) when a valid password has not already been supplied to the session. (If a valid password for that table has already been supplied, the OnPassword event does not occur.)
The other circumstance is a call to the GetPassword method. GetPassword either generates an OnPassword event, or, if the session does not have an OnPassword event handler, displays a default password dialog. It returns True if the OnPassword event handler or default dialog added a password to the session, and False if no entry at all was made.

In the following example, the Password method is designated as the OnPassword event handler for the default session by assigning it to the global Session object抯 OnPassword property.

procedure TForm1.FormCreate(Sender: TObject);

begin
Session.OnPassword := Password;
end;

In the Password method, the InputBox function prompts the user for a password. The AddPassword method then programmatically supplies the password entered in the dialog to the session.

procedure TForm1.Password(Sender: TObject; var Continue: Boolean);

var
Passwrd: String;
begin
Passwrd := InputBox('Enter password', 'Password:', '');
Continue := (Passwrd > '');
Session.AddPassword(Passwrd);
end;

The OnPassword event (and thus the Password event handler) is triggered by an attempt to open a password-protected table, as demonstrated below. Even though the user is prompted for a password in the handler for the OnPassword event, the table open attempt can still fail if they enter an invalid password or something else goes wrong.

procedure TForm1.OpenTableBtnClick(Sender: TObject);

const
CRLF = #13 + #10;
begin
try
Table1.Open; { this line triggers the OnPassword event }
except
on E:Exception do begin { exception if cannot open table }
ShowMessage('Error!' + CRLF + { display error explaining what happened }
E.Message + CRLF +
'Terminating application...');
Application.Terminate; { end the application }

end;
end;
end;


这是Delphi帮助文件里的,如果小妹的英语还不错的话,这个一定对你有帮助。
据我了解女孩的英文都不错哟!:)
 
“让用户自己设置级别的权限”?,好像没有这个必要吧。你可以设置一个系统管理员
用户,让他拥有所有权限。其它人的权限由这个系统管理员来设定。

“根据用户的权限动态改变菜单的VISIBLE属性”,可以将它放在一个procedure里,需要
时进行调用。

按照日期先后同时把两个表显示在一个表格里:
select *
from aTabale,bTable
where aTable.日期=bTable.日期 and aTable.产品代码=bTable.产品代码
order by aTable.日期,bTable.日期
 
关联表的方法:你搜索一下吧,大把的是!
 
大哥我有心殺zui,無力回天,要面談!
 
TO:小唐
假如入库表里面有A产品,出库表里面没有A产品,按你上面说的能查出下面的效果吗?
----------------------------------------------------------------------------
产品代码 日期 入库数 出库数 结余数
A 2002-07-30 10 10
aTable.产品代码=bTable.产品代码条件不成立呀
 
[8D][:D][:)][:(!][:(][8D]怎么女人一上来,这些爷们就象猫儿见了鱼一样?
真是的!!程序员真的很寂寞吗?
找个女朋友嘛!!
 
你要干嘛?洋洋
 
进销存明细帐到底要怎么编啊,能一条SQL就搞掂的吗?给点思路也行啊,大侠们,
拜托拜托!!!!
 
后退
顶部