日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

java linux mdb,在Linux下实现对Microsoft Access Database(.mdb)查询访问

發(fā)布時(shí)間:2023/12/14 linux 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java linux mdb,在Linux下实现对Microsoft Access Database(.mdb)查询访问 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

在Linux下實(shí)現(xiàn)對(duì)Microsoft?Access?Database(.mdb)查詢?cè)L問

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

from http://www.517sou.net/blogview.asp?logID=1069&cateID=12

延伸閱讀coded by nessus

總結(jié)

以上是生活随笔為你收集整理的java linux mdb,在Linux下实现对Microsoft Access Database(.mdb)查询访问的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。