Well, I've been supported by everyone. Now successfully switching access data into MySQL form, I will dedicate to those who need to _php tutorial

Source: Internet
Author: User
Tags dsn
The first step, prepare the database. Install the data source (this will cost me several days), first click on the Control Panel
ODBC data Source (32-bit)
, click Enter to select
User DSN (which is actually the default)
, in which you select
For MS ACCESS, click the Configure button to the right of this option.
Will come out a window name is: [Odbc Microsoft Installation].
Select the database you want to call in the section. (Select Selection button)
Then clicking on the Advanced option on its right will bring up a [advanced settings option] where the user password and user name (each name is recorded), click on the option type below the column
DefaultDir, enter your database (that is, the Access database) in the bottom value. Then make sure to go back to the initial position (user DSN), this time start [add] The data source you just added, select *.mdb (that is, access), click Done. Go to another page, at the beginning of the data source: Data your database Source name: (for example, I used to use the Taici.mdb, then in which you can enter the Taici now). Then be sure to choose the database you are looking for. OK, now the database can be over.
The second step, that is the problem of program switching.
$CNX = Odbc_connect (' Taici ', ' Admin ', ' WSD ');
Do you remember? Teach you to enter the user and password when you remember, is the admin and WSD, know how to do it?!
$cur = odbc_exec ($CNX, ' select * from word ');
Where word is one of the tables Taici
$num _row=0;
$conn =mysql_pconnect ("localhost", "WSD", "WSD");//connection to MySQL
@mysql_select_db (' SMS ', $conn) or
Die ("Cannot connect to the database, please contact the Administrator!") ");//Open MySQL's mydb database
while (Odbc_fetch_row ($cur))//Extract the data from the user table in the MyDB Library of SQL Server, and if you select the data, you can add the conditional judgment in the previous SELECT statement
{
$num _row++;
$field 1 = Odbc_result ($cur, 1); Here's the parameter I (A.) Refers to the I field in the Recordset, you can select selectively, Fieldi get the value of the corresponding field, then you can manipulate the Fieldi
$field 2 = Odbc_result ($cur, 2);
$field 3 = Odbc_result ($cur, 3);
$field 4 = Odbc_result ($cur, 4);

http://www.bkjia.com/PHPjc/631436.html www.bkjia.com true http://www.bkjia.com/PHPjc/631436.html techarticle The first step, prepare the database. Install the data source (this will cost me a few days), first click on the Control Panel of the ODBC data source (32-bit), click Enter after the Select User D ...

  • 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.