使用的vb6+adodc+access,sql语句查询错误
DimstrAsStringDimpathAsStringpath=App.pathstr=pathIfRight(str,1)<>"\"Thenstr=str+"\"E...
Dim str As String
Dim path As String
path = App.path
str = path
If Right(str, 1) <> "\" Then
str = str + "\"
Else
str = str
End If
str = "Provider=Microsoft.Jet.OLEDB.4.0;;Persist Security Info=False;Data Source=" & str & "studentsinfo.mdb"
Adodc1.Recordset.Open "select * from information", str, adOpenStatic, adLockOptimistic
使用的vb6+adodc+access。
请问怎么回事啊?
2楼的,谢谢了,我改为了Dim str As String
Dim path As String
path = App.path
str = path
If Right(str, 1) <> "\" Then
str = str + "\"
Else
str = str
End If
str = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & str & "studentsinfo.mdb"
Adodc1.ConnectionString = str
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "select * from information"
Adodc1.Refresh
后提示我 from子句语法错误,郁闷阿。
我知道了,应该把Adodc1.CommandType = adCmdTable改成adcmdtext。 展开
Dim path As String
path = App.path
str = path
If Right(str, 1) <> "\" Then
str = str + "\"
Else
str = str
End If
str = "Provider=Microsoft.Jet.OLEDB.4.0;;Persist Security Info=False;Data Source=" & str & "studentsinfo.mdb"
Adodc1.Recordset.Open "select * from information", str, adOpenStatic, adLockOptimistic
使用的vb6+adodc+access。
请问怎么回事啊?
2楼的,谢谢了,我改为了Dim str As String
Dim path As String
path = App.path
str = path
If Right(str, 1) <> "\" Then
str = str + "\"
Else
str = str
End If
str = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & str & "studentsinfo.mdb"
Adodc1.ConnectionString = str
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "select * from information"
Adodc1.Refresh
后提示我 from子句语法错误,郁闷阿。
我知道了,应该把Adodc1.CommandType = adCmdTable改成adcmdtext。 展开
1个回答
展开全部
你使用ADO控件,就不要使用ADO数据对象,代码修改如下:
Dim str As String
Dim path As String
path = App.path
str = path
If Right(str, 1) <> "\" Then
str = str + "\"
Else
str = str
End If
str = "Provider=Microsoft.Jet.OLEDB.4.0;;Persist Security Info=False;Data Source=" & str & "studentsinfo.mdb"
Adodc1.ConnectionString = str
Adodc1.RecordSource = "select * from information"
Adodc1.Refresh
其它请参阅http://zhidao.baidu.com/question/18200814.html的本人答复.
Dim str As String
Dim path As String
path = App.path
str = path
If Right(str, 1) <> "\" Then
str = str + "\"
Else
str = str
End If
str = "Provider=Microsoft.Jet.OLEDB.4.0;;Persist Security Info=False;Data Source=" & str & "studentsinfo.mdb"
Adodc1.ConnectionString = str
Adodc1.RecordSource = "select * from information"
Adodc1.Refresh
其它请参阅http://zhidao.baidu.com/question/18200814.html的本人答复.
启帆信息
2024-11-19 广告
2024-11-19 广告
启帆信息是英伟达中国区代理商,原厂授权代理,提供全面的软件技术解决方案以及NVIDIA以太网产品、交换机等产品,欢迎前来咨询!...
点击进入详情页
本回答由启帆信息提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询