标题:vb调用access出错
只看楼主
princezhang
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-7-25
 问题点数:0 回复次数:1 
vb调用access出错

Dim StrId As String
Dim StrFirstName As String
Dim TmpStr As String
Dim Con As New ADODB.Connection
Dim Rs As New ADODB.Recordset
Dim strSql As String
strSql = "select * from [second]"
TmpStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\桌面\first.mdb;Persist Security Info=False;"
Con.ConnectionString = TmpStr
Con.CursorLocation = adUseClient
Con.Open
Rs.CursorType = adOpenKeyset
Rs.LockType = adLockOptimistic
Rs.Open strSql, Con, adOpenKeyset, adLockPessimistic
StrId = Trim(InputBox("请输入职员代码:"))
StrFirstName = Trim(InputBox("请输入姓"))
Rs.AddNew
Rs!NumOfSection = StrId
Rs!NumOfOil = StrFirstName
Rs.Update
Rs.Close
Con.Close

老是提示我from子句语法错误,请高手指点

搜索更多相关主题的帖子: access 
2006-07-25 14:21
liang1218
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2006-7-24
得分:0 

请问有没有加载ADODC控件呢

2006-07-25 19:25



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




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

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