
910 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a software in Access that is microsoft 365. I want to open a table in another Access database and show some of information of this table in my form. I want to use ADO.
But when I execute my code, I get the error: Could not find installable ISAM.
I don't know why?
Private Sub cmdGetConnectionInfo_Click()
'get the information of server from the connection Database
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strConnection As String
'Specify the connection string for connecting to connection database
strConnection = "Provider=Microsoft.ACE.OLEDB.16.0;" & _
"DataSource=" & "J:\Kraseh\ConnectionInfo.accdb;"
'Create a new connection instance and open it using the connection string
Set cn = New ADODB.Connection
cn.Open strConnection
'Create a new instance of a recordset
Set rs = New ADODB.Recordset
'set various properties of the recordset
With rs
'specify a cursor type and lock type that will allow updates
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.LockType = adLockOptimistic
'open the recordset based on tblConnection table using the existing connection
.Open "tblConnectionInfo", cn
End With
'if the recordset is empty
If rs.BOF And rs.EOF Then
MsgBox "ÏÑ ÌÏæá ÊäÙíãÇÊ ÏÇÏå Çí æÌæÏ äÏÇÑÏ", vbOKOnly + vbMsgBoxRight + vbMsgBoxRtlReading, "ÎØÇí ÏÇÏå"
Exit Sub
'if the recordset is not empty,then bind the recordset property of form to the rs recordset
Else
Set Me.Recordset = rs
End If
'bind the controls of the form to the proper fields in the recordset
Me.txtID.ControlSource = "ID"
Me.txtServer.ControlSource = "Server"
Me.txtPort.ControlSource = "Port"
Me.txtDataBaseName.ControlSource = "DataBaseName"
Me.txtUserName.ControlSource = "UserName"
Me.txtPassword.ControlSource = "Password"
Me.chkTrustedConnection.ControlSource = "TrustedConnection"
End Sub
If you then click Debug, what line is highlighted?