Connection Ok but ADODB connection to database did not display query results

2 次查看(过去 30 天)
Hello everyone, I am using ADODB data access object to access and display content of a database. The connection is ok up to the line: dbConn.Open(conn); % Open connection, however when it comes to displaying the results I got an error: %---------------- Attempt to reference field of non-structure array. Error in adodb_query (line 54) ado_recordset = ado_connection.Execute(sql);
Error in try_DB (line 17) [Struct, Table] = adodb_query(conn, 'select * from NYC_ind_count where userid=1'); %------------------- The code is as follows:
dbConn = actxserver('ADODB.Connection'); conn = 'DRIVER=SQLite3 ODBC Driver;Database=C:\Users\User\selection_set.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0'; dbConn.CursorLocation = 'adUseClient'; dbConn.Open(conn); % Open connection
%% Access: Read multiple records from DB [Struct, Table] = adodb_query(conn, 'select * from NYC_ind_count where userid=1'); disp('Output in struct format:') disp(Struct) disp('') disp('Output in in table format:') disp(Table)
Please I need clarification on what is wrong. Any assistance will be greatly appreciated. Thank you.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by