一直都是做.NET开发的 前天接一delphi项目
昨天刚接触delphi,今天boss就让学数据连接 希望前辈们能给点提示
我希望前辈们能写出来发到我的邮箱
我只是想快点入门 谢谢。
数据库用4个字段 id,name,sex,age
有4个edit (附有图片,双击应该能看大图)
查询的时候在 edit1 中输入 id号 就可以把结果显示在对应name...字段的edit中
删除
更改
增加
显示全部的按钮的事件就不用写了恩 怎么样才能从edit输入,然后查询的内容显示到dbgrid中?
谢谢。
解决方案 »
- dbgrid问题???????在线
- 组件制作的一个小问题
- 能不能在ADOQuery控件的SQL语句中引用一个组合框列表中的数值?急!
- delphi7中怎么没有TClientSocket和TServerSocket?
- 分支定界求方程的根
- TO cutelocust,倒分很简单;下边问题回答了,分就是你的了
- 如何获得系统菜单选择事件:如"还原","最小化"等?
- 请问在DELPHI中如何调用扫描仪
- 100分,提问两个关于SQLServer的问题。
- 这样一个软件可开价多少?
- 继续问下hint的相关问题
- 有谁做过Apache Shared Modules,我用delphi7开发的so,用apache2.2.4加载会导致appache无法启动
adoconnection1.LoginPrompt :=false;
adoconnection1.Connected :=true;
var
uid,name,password,state, authority : String;
i : Integer;
begin
//增加用户
uid := bsSkinEdit1.Text;
password := MD5Print(MD5String(bsSkinPasswordEdit1.Text));
//password := bsSkinPasswordEdit1.Text;
name := bsSkinEdit2.Text;
state := IntToStr(bsSkinComboBox1.ItemIndex);
if buttonstate=1 then
begin
authority := '';
for i:=0 to bsSkinCheckListBox1.Items.Count-1 do
begin
if bsSkinCheckListBox1.Checked[i] = True then
authority := authority + '1'
else
authority := authority + '0';
end; if uid = '' then
begin
MessageBox(Handle, '请输入登录名称!', '提示', MB_ICONASTERISK);
bsSkinEdit1.SetFocus;
exit;
end; if name = '' then
begin
MessageBox(Handle, '请输入操作员姓名!', '提示', MB_ICONASTERISK);
bsSkinEdit2.SetFocus;
exit;
end; if bsSkinPasswordEdit1.Text = '' then
begin
MessageBox(Handle, '请输入密码!', '提示', MB_ICONASTERISK);
bsSkinPasswordEdit1.SetFocus;
exit;
end; if bsSkinPasswordEdit1.Text <> bsSkinPasswordEdit2.Text then
begin
MessageBox(Handle, '密码与密码确认不一致,请重新输入密码!', '提示',
MB_ICONASTERISK);
exit;
end; DSQuery := TSDQuery.Create(nil);
DSQuery.DatabaseName := 'timecarddb';
DSQuery.SQL.Clear;
DSQuery.SQL.Add( 'select * from operatorstb where uid='+quotedstr(uid));
try
DSQuery.Open;
if not DSQuery.Eof then
begin
MessageBox(Handle, '输入的登录名称已经存在,请重新输入!', '提示',
MB_ICONASTERISK);
exit;
end else
DSQuery.Close;
DSQuery.SQL.Clear;
DSQuery.SQL.Add( 'insert into operatorstb (uid,password,name,authority,'+
'state) values ('+quotedstr(uid)+',('+quotedstr(password)+'),'+
quotedstr(name)+','+quotedstr(authority)+','+quotedstr(state)+')');
DSQuery.ExecSQL();
MessageBox(Handle, '添加用户成功!', '提示',
MB_ICONASTERISK);
DSQuery.Close;
finally
DSQuery.Free;
end;
//SetsystemForm.UserShow;
SetSystermForm.OperatorsShow;
Close;
end;