| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 534 人关注过本帖
标题:我是新手请来帮个忙?
只看楼主 加入收藏
随风的故事
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
快速回复:我是新手请来帮个忙?
数据加载中...
 
   



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

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