Connection Ok but ADODB connection to database did not display query results
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Database Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!