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

조회 수: 3 (최근 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