iankerry
Registered User.
- Local time
- Today, 18:39
- Joined
- Aug 10, 2005
- Messages
- 190
Hi All,
I have been using this button for years and it has always worked. The button puts info from the database into an email).
But suddenly I get the error -2147467259 ODBC "Cannot open database (unknown). It may not be a database that your application recognizes or the file may be corrupt".
I have tried backups going back many months and get the same message. So I don't think it is corrupt.
I am on Win 7 - Access 2013. Connect to an SQL server. Here is the code that it stops on the cn.open command:
I have double, nay triple, checked the name and path.
As I say nothing that I know of has changed - unless MS has done an update. So I can't work out why it has suddenly stopped working.
Anyone any ideas please?!
Thanks
Ian
I have been using this button for years and it has always worked. The button puts info from the database into an email).
But suddenly I get the error -2147467259 ODBC "Cannot open database (unknown). It may not be a database that your application recognizes or the file may be corrupt".
I have tried backups going back many months and get the same message. So I don't think it is corrupt.
I am on Win 7 - Access 2013. Connect to an SQL server. Here is the code that it stops on the cn.open command:
Code:
Public Function OpenConnection() As Boolean
On Error GoTo OpenConnection_Err
Set cn = New ADODB.Connection
If cn.State <> adStateClosed Then cn.Close
cn = "Driver={Microsoft Access Driver (*.mdb, *.accdb)};" & _
"Dbq=flicks database.accdb;" & _
"DefaultDir=z:\databases\;" & _
"Uid=Admin;Pwd=;"
MsgBox cn
[COLOR="Red"] cn.Open[/COLOR]
cn.CommandTimeout = 0
Set rs = New ADODB.Recordset
If cn.State <> adStateClosed Then OpenConnection = True
I have double, nay triple, checked the name and path.
As I say nothing that I know of has changed - unless MS has done an update. So I can't work out why it has suddenly stopped working.
Anyone any ideas please?!
Thanks
Ian