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