level 1
luyaqi88
楼主
若用的是MSFlexGrid,通过下面代码可以正常显示
strCn = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;" & _
"Data Source= 地址\表格.mdb"
rs.ConnectionString = strCn
rs.Open
With JZ
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open "A", rs, adOpenStatic, adLockBatchOptimistic
End With
If JZ.BOF = True Then
Else
JZ.MoveFirst
Do While Not JZ.EOF
If JZ!工程师 = Text_姓名.Text Then
MSFlexGrid校准.AddItem (JZ!夹具编号 & vbTab & JZ!夹具名称 & vbTab & JZ!工程师)
End If
JZ.MoveNext
Loop
End If
若是用的DataGrid及Adodc,07版的可以正常使用,03版则数据是空白,代码如下:
Adodc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=地址\表格.mdb;Persist Security Info=False"
Adodc.RecordSource = "SELECT 夹具名称,夹具编号,工程师 FROM A"
Adodc.Refresh
而DataGrid.dataSource=Adodc
如果电脑装的ACCESS是2007版本的,可以正常使用,如何ACCESS是2003版本的,显示的为空白。
请问这个问题如何解决?
2013年02月20日 00点02分
1
strCn = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;" & _
"Data Source= 地址\表格.mdb"
rs.ConnectionString = strCn
rs.Open
With JZ
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open "A", rs, adOpenStatic, adLockBatchOptimistic
End With
If JZ.BOF = True Then
Else
JZ.MoveFirst
Do While Not JZ.EOF
If JZ!工程师 = Text_姓名.Text Then
MSFlexGrid校准.AddItem (JZ!夹具编号 & vbTab & JZ!夹具名称 & vbTab & JZ!工程师)
End If
JZ.MoveNext
Loop
End If
若是用的DataGrid及Adodc,07版的可以正常使用,03版则数据是空白,代码如下:
Adodc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=地址\表格.mdb;Persist Security Info=False"
Adodc.RecordSource = "SELECT 夹具名称,夹具编号,工程师 FROM A"
Adodc.Refresh
而DataGrid.dataSource=Adodc
如果电脑装的ACCESS是2007版本的,可以正常使用,如何ACCESS是2003版本的,显示的为空白。
请问这个问题如何解决?