• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            <2006年10月>
            24252627282930
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            統(tǒng)計(jì)

            • 隨筆 - 44
            • 文章 - 0
            • 評(píng)論 - 86
            • 引用 - 0

            常用鏈接

            留言簿(6)

            隨筆分類(31)

            隨筆檔案(44)

            Mining

            最新隨筆

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            在Linux下實(shí)現(xiàn)對(duì)Microsoft Access Database(.mdb)查詢?cè)L問(wèn)
            介紹了如何在Linux訪問(wèn)MDB數(shù)據(jù)庫(kù), 感覺(jué)非常有用:)

            You will need the following:
            Linux ( I’m running RedHat 9.0)
            PHP
            Apache
            UnixODBC
            MDBTools

            INSTRUCTIONS
            1) Download the UnixODBC RPM, found here. I installed unixODBC version 2.2.5.1.
            rpm -ivh unixODBC-2-2.5-1.i386.rpm

            2) Download the MDBTools rpm, found here. I installed mdbtools version 0.5.1. Read limitations!
            rpm -ivh mdvtools-0.5-1.i386.rpm

            3) Download the MDBTools ODBC driver rpm. Again I installed version 0.5-1.i386.rpm. Read limitations!
            rpm -ivh mdbtools-odbc-0.5-1.i386.rpm

            4) Add the mdbtools driver to your unixODBC config.
            Create a new text file. NON-LINUX user: Beware do not do this on windows as you might get werid new lines, use vi.

            [MDBToolsODBC]
            Description = MDB Tools ODBC drivers
            Driver = /usr/lib/libmdbodbc.so.0
            Setup =
            FileUsage = 1
            CPTimeout =
            CPReuse =


            NOTE: The driver may be in /usr/local/lib/libmdbodbc.so.0. This happens if you build from source and use the make install command. The RPM puts it in /usr/lib.
            Now install the driver using the file you created. This is called a template file.
            odbcinst -i -d -f template.file

            5) Define the datasource name. This is done in the /etc/odbc.ini file. So pull up this file in vi or another text editor and add the following lines.

            [Dogs]
            Description = Microsoft Access Database of Dogs
            Driver = MDBToolsODBC
            Database = /var/data/my_dog_db.mdb
            Servername = localhost
            UserName =
            Password =
            port = 5432


            That’s it you should now have an odbc connection available. I will demonstrate using php, this assumes that your php is compiled with UnixODBC support, the version that ships with Redhat 9 does if yours does not then you can learn how here.

            So I will write a quick php script to query my dogs database and print out the names and weights of my dogs.

            $myDB = odbc_connect(”Dogs”,”",”");
            $query = “select name, weight from dog_list”;
            $result = odbc_exec($myDB, $query);
            while (odbc_fetch_row($result)) {
            print “Name = ” . odbc_result($result,”name”);
            print “
            Weight = ” . odbc_result($result,”weight”);
            }


            If you get a php error that says odbc_connect is not a function then see if you have php-odbc installed. Do rpm -qa php-odbc. If you see php-odbc returned then you have it if not install it., the rpm is available on the redhat discs.

            Limitations:
            - As of the time of writing this entry MDBTools did not support write access to the mdb files. This was fine for my purposes as I was reading data in and sticking it into a mysql database.
            - There is a bug in MDBTools v0.5 which does not allow you to query tables or columns with an underscore. This was a bug I hit early on, but it has been fixed in new version 0.6 but that has not been released as of the time of writing this article. So I recompiled the 0.5 source code with the fix from the 0.6 CVS repository. I have bundled it into a 0.5 release and have the two rpms mentioned above here:
            mdbtools-0.5-1.i386.rpm
            mdbtools-odbc-0.5-1.i386.rpm

            I would check the official download site before using my hacked version as I’m sure this bug will be fixed in 0.6 (plus rumor has write access will be present as well).

            posted on 2006-10-09 11:19 泡泡牛 閱讀(5842) 評(píng)論(0)  編輯 收藏 引用 所屬分類: Linux


            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


            狠狠色丁香久久婷婷综合图片 | 7777精品久久久大香线蕉| 国产一区二区精品久久凹凸 | 久久精品中文字幕一区| 精品伊人久久大线蕉色首页| 国内精品久久久久久久久电影网| 久久发布国产伦子伦精品| 一本伊大人香蕉久久网手机| 亚洲欧美日韩精品久久亚洲区| 婷婷久久久亚洲欧洲日产国码AV| 国产精品18久久久久久vr| 久久精品国产只有精品66| 国内精品久久久久久久久电影网| 亚洲国产精品婷婷久久| 一级做a爰片久久毛片免费陪| 99久久精品费精品国产一区二区| 国产精品无码久久综合网| 人妻精品久久久久中文字幕一冢本| 99久久无色码中文字幕| 中文字幕乱码久久午夜| 久久综合成人网| 人人狠狠综合久久亚洲88| 久久久久久国产精品免费无码| 理论片午午伦夜理片久久| 国产精品一久久香蕉产线看| 久久久久亚洲AV无码观看| 久久精品无码一区二区三区免费| 久久久无码精品亚洲日韩按摩| 大香伊人久久精品一区二区| 精品久久久久久无码中文野结衣| 国产一区二区三区久久| 五月丁香综合激情六月久久| 一本色综合久久| 亚洲国产香蕉人人爽成AV片久久| 国产精品美女久久久久AV福利| 久久久久久免费一区二区三区| 久久亚洲精品成人AV| 国产精品美女久久久久| 久久精品蜜芽亚洲国产AV| 久久久久女人精品毛片| 久久久久亚洲AV无码麻豆|