标题:我是新手请来帮个忙?
只看楼主
随风的故事
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2005-10-8
 问题点数:0 回复次数:1 
我是新手请来帮个忙?

我在VB中的代码什么地方错了啊,应该怎么该,才能选择性的输入text2.text啊
If cnn.State <> 0 Then
cnn.Close
End If
Dim strSql As String
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\sem1\温建峰\温建峰\equipment\equipment.mdb;Persist Security Info=False"
cnn.Open
strSql = " insert into equipment values(" _
& "'" & Text1.Text & "'," _
& "'" & Text2.Text & "'," _
& "'" & Text3.Text & "'," _
& "'" & Text4.Text & "')"
cnn.Execute strSql
If MsgBox("已保存是否继续", vbQuestion + vbYesNo, "消息") = vbYes Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End If

搜索更多相关主题的帖子: Microsoft cnn 
2005-11-03 21:02
leon2
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:731
专家分:0
注 册:2005-3-18
得分:0 

Dim strSql As String, rsRecord As RecordSet
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\sem1\温建峰\温建峰\equipment\equipment.mdb;Persist Security Info=False"
cnn.Open
rsRecord.Open "SELECT * FROM equipment", conn, 1, 3
rsRecord.AddNew
rsRecord(1) = Text1.Text
If Text2.Text <> "" Then rsRecord(2) = Text2.Text
rsRecord(3) = Text3.Text
rsRecord(4) = Text4.Text
rsRecord.Update

2005-11-03 22:16



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-32501-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025344 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved