我是菜鸟,大家帮我看一下,下面哪地方出错了,谢谢!!
Private Sub Form_Click()
Dim s As String
Dim Conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\xuexi\vb6.0\bf\data.mdb" '打开数据库
'关闭数据库
Conn.Close
Set Conn = Nothing
'读取数据
Dim rs As New ADODB.Recordset
Dim spl1 As String
Dim plan As String
Dim sex As String
Dim bx_years As String
Dim tb_years As String
plan = InputBox("请选择计划")
sex = InputBox("请选择性别")
bx_years = InputBox("请选择保险期间")
tb_years = InputBox("请输入投保年龄")
sql1= "select id form jb where plan='"&plan&"' and sex='"&sex&"' and bx_years='"&bx_years&"' and tb_years='"&tb_years&"'"
VB缺少:结束语句
答案:3 悬赏:70
解决时间 2021-02-19 16:21
- 提问者网友:妖精ξ也會哭
- 2021-02-18 18:39
最佳答案
- 二级知识专家网友:duile
- 2021-02-18 19:08
你在最后写上end sub就OK
Private Sub Form_Click()
Dim s As String
Dim Conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\xuexi\vb6.0\bf\data.mdb" '打开数据库
'关闭数据库
Conn.Close
Set Conn = Nothing
'读取数据
Dim rs As New ADODB.Recordset
Dim spl1 As String
Dim plan As String
Dim sex As String
Dim bx_years As String
Dim tb_years As String
plan = InputBox("请选择计划")
sex = InputBox("请选择性别")
bx_years = InputBox("请选择保险期间")
tb_years = InputBox("请输入投保年龄")
sql1= "select id form jb where plan='"&plan&"' and sex='"&sex&"' and bx_years='"&bx_years&"' and tb_years='"&tb_years&"'"
end sub
Private Sub Form_Click()
Dim s As String
Dim Conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\xuexi\vb6.0\bf\data.mdb" '打开数据库
'关闭数据库
Conn.Close
Set Conn = Nothing
'读取数据
Dim rs As New ADODB.Recordset
Dim spl1 As String
Dim plan As String
Dim sex As String
Dim bx_years As String
Dim tb_years As String
plan = InputBox("请选择计划")
sex = InputBox("请选择性别")
bx_years = InputBox("请选择保险期间")
tb_years = InputBox("请输入投保年龄")
sql1= "select id form jb where plan='"&plan&"' and sex='"&sex&"' and bx_years='"&bx_years&"' and tb_years='"&tb_years&"'"
end sub
全部回答
- 1楼网友:而你却相形见绌
- 2021-02-18 19:58
private sub command1_click()
if option1 then
form2.show
form1.hide '两个语句不要连成一句了
else
end '//退出程序
end if
end sub ' 缺少过程结束语句
'在form2窗口加入下面代码,不然有隐藏窗口在,程序退不出了。
private sub form_unload(cancel as integer)
form1.show
end sub
- 2楼网友:深街酒徒
- 2021-02-18 19:45
.....
sql1= "select id from jb where plan='"&plan&"' and sex='"&sex&"' and bx_years='"&bx_years&"' and tb_years='"&tb_years&"'"
......
end sub
还有应该是select id from jb吧
xuyl1982 加油!!总有一天你会成为一个很牛的回答者~~
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯