vb 查询数据库老是提示“from子句语法错误”。刚学vb,帮忙指点~~
PrivateSubForm_Load()WithAdodc1.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;"_...
Private Sub Form_Load()
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & App.Path & "\qddata.MDB;Persist Security Info=False"
.CommandType = adCmdTable
.RecordSource = "select * from FCB where ZYID =" & 1 & ""
Set MSHFlexGrid1.DataSource = Adodc1 '显示到MSHFlexGrid1中
.Refresh '刷新
End With
End Sub
顺便问下,想查询所有第六位数字等于1的怎么写呢。或者第四位等于2的。举2个数据010101006和010201001 展开
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & App.Path & "\qddata.MDB;Persist Security Info=False"
.CommandType = adCmdTable
.RecordSource = "select * from FCB where ZYID =" & 1 & ""
Set MSHFlexGrid1.DataSource = Adodc1 '显示到MSHFlexGrid1中
.Refresh '刷新
End With
End Sub
顺便问下,想查询所有第六位数字等于1的怎么写呢。或者第四位等于2的。举2个数据010101006和010201001 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询