pb 向access中插入数据 出错!

jianbo8807 2009-03-15 04:51:53

if sle_user.text="" or sle_pass.text="" then
messagebox("woring","please insert userid or password")
sle_user.setfocus()
else
string myid,mypass;
myid=sle_user.text
mypass=sle_pass.text
insert into t_user(user_id,user_password) values (:myid,:mypass)

messagebox("infomation","insert scucess")
end if
以上代码是在注册按钮上写的, 编译出错:stntax error
错在哪呢.


...全文
145 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
珍妮邦德 2009-03-16
  • 打赏
  • 举报
回复
加分号
jianbo8807 2009-03-16
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 newease 的回复:]
upper 是字母转成大写

你最好DEBUG一下,看看你的pawd 值是多少,如果有数值的话

那再试一下,
if upper(trim(getpass)) = upper(trim(pawd)) then

有可能你的数据库里用char类型
[/Quote]

pawd 好像是空的,,我库里用的都是char型
debug 怎么弄呀,,刚接触pb 能详细点吗
newease 2009-03-16
  • 打赏
  • 举报
回复
upper 是字母转成大写

你最好DEBUG一下,看看你的pawd 值是多少,如果有数值的话

那再试一下,
if upper(trim(getpass)) = upper(trim(pawd)) then

有可能你的数据库里用char类型
yuan1215 2009-03-16
  • 打赏
  • 举报
回复
select user_password into:pawd
from t_user
where user_id=:getid;
jianbo8807 2009-03-16
  • 打赏
  • 举报
回复
验证成功了 谢谢你们
把where [user_id]=:getid; 改成where user_id=:getid; 就ok了 为什么呢
tomorrower 2009-03-15
  • 打赏
  • 举报
回复
怎么会这样:where [user_id]=:getid;

编译就不能通过啊?
jianbo8807 2009-03-15
  • 打赏
  • 举报
回复
upper 什么呀,,加上还是有错啊
lovemoreh 2009-03-15
  • 打赏
  • 举报
回复
if upper(getpass) = upper(pawd) then
jianbo8807 2009-03-15
  • 打赏
  • 举报
回复
en 太粗心啦
再麻烦下,这是我的登陆验证
if sle_user.text="" or sle_pass.text="" then
messagebox("woring","please insert userid or password")
sle_user.setfocus()

else
string getid,getpass,pawd;

getid=sle_user.text
getpass=sle_pass.text

select user_password into:pawd
from t_user
where [user_id]=:getid;

if getpass=pawd then
open (w_main)
else
messagebox("woring"," userid or password is wrong
")
sle_user.setfocus()
end if
end if
我输入正确的用户名和密码,都弹出那个消息框 userid or password is wrong 啊 问题出在哪呢,,,,加分
wwwzxl 2009-03-15
  • 打赏
  • 举报
回复
up
lovemoreh 2009-03-15
  • 打赏
  • 举报
回复
sql语句最后要加;号。
jianbo8807 2009-03-15
  • 打赏
  • 举报
回复
数据库连接上了 但查看和insert都出现上面的错误。

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧