Matlab Connect to an Access database

Source: Internet
Author: User

1. Create a Windows system ODBC data source < Open Control Panel----Administrative Tools----ODBC data source (32-bit or 64-bit)----Add a driver for----installation data source Microsoft Access Driver (MDB,ACCDB) ----Determine the name of the----data source (for example: sample; Advanced can set the user name and password, the code will be used, not set, the code is empty)----database selection (databasesample.mdb)----OK >

2. You can use the Database Toolbox (QueryBuilder) or code programming in a way that describes how to program:

(1) Connection database: Conn=database (Sample, ' username ', ' password ');

(2) The test database is connected successfully;

(3) Open cursor, execute SQL statement: CURSOR=EXEC (conn, ' select * from Databasesample ') this out can also perform SQL update (add, delete) database information;

(4) Reading data from the cursor: result=fetch (cursor) The data type of result is cell;

(5) Close cursors and Links: close (cursor); close (conn);

3. The resulting data exists in result, and the MATLAB statement is executed to obtain the data; '

Matlab Connect to an Access database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.