I have this workbook that I ran on windows 7 but it will ont open the connection to access db in windows 10. every time it goes to run the line
cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & AccessFile
it just says not responding and restarts excel.
any ideas why? thank you
Set cnn = New ADODB.Connection
cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & AccessFile
cnn.CursorLocation = adUseClient
Set rs = New ADODB.Recordset
rs.Open SQL, ActiveConnection:=cnn, _
CursorType:=adOpenDynamic, LockType:=adLockOptimistic, _
Options:=adCmdText
If rs.EOF And rs.BOF Then
rs.Close
cnn.Close
Set rs = Nothing
Set cnn = Nothing
Application.ScreenUpdating = True
MsgBox "No records found!", vbCritical, "No Records"
Exit Sub
End If
Bookmarks