COM.ADODB connection error
Mostrar comentarios más antiguos
I am trying to connect to a MS Access database using the actxserver (64-bit version of MATLAB and MS Office).
conn = actxserver('ADODB.Connection');
conn.CursorLocation = 'adUseClient';
conn.Open('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=H:\Database.accdb; Persist Security Info=False;);
rs = conn.Execute(sqlQuery); -> Error Line
The code works 90% of the time, but sometimes I get an error.
Error Message:
Error using COM.ADODB_Command/Execute
Error: Object returned error code: 0x214A14E8 (or 0xF6E01D00 etc. the number is not always the same)
Once the error occur, the only solution is to close Matlab and start a new session (simply re-running the script will result into another error every time).
The weird part is that while I was running the exact same script on 32-bit Maltab and 32-bit Access I never got any errors (note: when I upgrade the Office and Matlab, I deleted the 32-bit versions of both). Given that Maltab does not provide any documentation on COM.ADODB does anybody have any ideas what might be the source of the error and/or how to debug it?
Respuestas (1)
sm
el 20 de En. de 2016
0 votos
Categorías
Más información sobre Environment and Settings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!