我将该db1.mdb用独占方式打开设立了同样的密码:123456,
并在下面粘贴了同样的代码如下:
Private Sub Form_Load()
Text1.Enabled = False
Text2.Enabled = False
...
...
On Error GoTo errHandle
Dim conString As String
conString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & App.Path & "\db1.mdb;Jet OleDb:DataBase Password=123456"
Dim Conn As New ADODB.Connection
Conn.Open conString
Conn.Close
Set Conn = Nothing
Exit Sub
errHandle:
MsgBox Err.Description
Exit Sub
Set Conn = CreateObject("ADODB.Connection")
With Conn
.ConnectionString = conString
.Open
End With
Rst.CursorLocation = adUseClient
Rst.Open "Select * From zymc1", Conn, adOpenKeyset, adLockPessimistic, adCmdText
If Rst.RecordCount > 0 Then
Text1.Text = Rst.Fields("dm").Value
Text2.Text = Rst.Fields("xm").Value
...
...
Else
Text1.Text = ""
Text2.Text = ""
...
...
End If
End Sub
怎么执行后,打开的却是控件图标和控件名称,根本没有显示数据,这怎么回事啊?!!!!!,再打开其他的表,同样也是控件图标和控件名称
我再关闭VB程序,打开ACCESS2000,发现正常,怎么不行了呢?
并在下面粘贴了同样的代码如下:
Private Sub Form_Load()
Text1.Enabled = False
Text2.Enabled = False
...
...
On Error GoTo errHandle
Dim conString As String
conString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & App.Path & "\db1.mdb;Jet OleDb:DataBase Password=123456"
Dim Conn As New ADODB.Connection
Conn.Open conString
Conn.Close
Set Conn = Nothing
Exit Sub
errHandle:
MsgBox Err.Description
Exit Sub
Set Conn = CreateObject("ADODB.Connection")
With Conn
.ConnectionString = conString
.Open
End With
Rst.CursorLocation = adUseClient
Rst.Open "Select * From zymc1", Conn, adOpenKeyset, adLockPessimistic, adCmdText
If Rst.RecordCount > 0 Then
Text1.Text = Rst.Fields("dm").Value
Text2.Text = Rst.Fields("xm").Value
...
...
Else
Text1.Text = ""
Text2.Text = ""
...
...
End If
End Sub
怎么执行后,打开的却是控件图标和控件名称,根本没有显示数据,这怎么回事啊?!!!!!,再打开其他的表,同样也是控件图标和控件名称
我再关闭VB程序,打开ACCESS2000,发现正常,怎么不行了呢?