高分求救;简单问题这句sql查询语句该怎么写?急等。。。。

wangyunyan 2003-07-16 10:30:42
高手:
本人正在做毕设,有个查询语句困扰了多个模快无法编译下去:
如下:
name=wangyunyan
sqlstr="select *from man where 姓名='&name'" 调试过程中此语句出错,显示缺少参数1
data1.recordsource=sqlstr
data1.refresh
请问该如何修改?谢谢
...全文
45 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
Primer2002cn 2003-07-18
  • 打赏
  • 举报
回复
sqlstr="select *from man where 姓名='" & name & "'"
给分!
strongfisher 2003-07-17
  • 打赏
  • 举报
回复
sqlstr="select * from man where 姓名='" & name & "'"
Alicky 2003-07-17
  • 打赏
  • 举报
回复
sqlstr="select *from man where 姓名='" & name & "'"
debug.print sqlstr '看一下对不对。
qpeg 2003-07-17
  • 打赏
  • 举报
回复
sqlstr="select * from man where 姓名='" & name & "'"
yipanchen 2003-07-17
  • 打赏
  • 举报
回复
哈哈,同意UP 的说法,在数据库中 字段要不要加 ‘’ “”很烦的我也经常犯错
建议看一下什么情况下加‘’“” SQL高级编程里有的
Abecedarian 2003-07-17
  • 打赏
  • 举报
回复
错了
姓名='" & name &"'"
Abecedarian 2003-07-17
  • 打赏
  • 举报
回复
姓名='" & name "'"
饮水需思源 2003-07-17
  • 打赏
  • 举报
回复
sqlstr="select * from man where 姓名='"& name &"'"
hqsee 2003-07-17
  • 打赏
  • 举报
回复
sqlstr="select *from man where 姓名='" & name "'"
gemgama 2003-07-17
  • 打赏
  • 举报
回复
dim sqlstr,name as string
sqlstr="select *from man where 姓名='" & name "'"
data1.recordsource=sqlstr
data1.refresh
Keown 2003-07-16
  • 打赏
  • 举报
回复
dim strName as string
dim strSQL as string
strName="wangyunyan"
strSQL=" select * from man where 姓名='"& strName &"'"
data1.recordsource=strSQL
data1.requery

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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