好了,我经过大家的支持现在已经成功的把access数据倒换为mysql形式,本人将奉献给那些需要的朋
第一步、做好数据库的准备。安装数据源(这个就费了我好几天了),首先点击控制面板中的
odbc数据源(32位)
,点击进入后选择
用户DSN(其实是默认的)
,在其中选择
MS ACCESS 97 DATABASE 这一选项,点击其右面的配置按钮。
会出来一个窗口名字是:[Odbc microsoft 安装]。
在其中间部分选择你所要调用的数据库。(选择选取按钮)
再在点击其右侧的高级选项,会弹出一个[高级设置选项]在其中设置用户密码和用户名(每个名称记好了),在栏目下方的选项类型中点击
defaultdir,在最下方的数值中输入你的数据库(也就是access 数据库)。然后一个个确定回到初始位置(用户DSN),这时候开始[添加]你刚才所加的数据源,选择*.mdb(就是access),点击完成。进入到另一个页,在开头数据源中:数据你的数据库源名:(比如我以前使用的是taici.mdb,那么现在在其中输入taici就可以了)。然后肯定要选择你要所找的数据库了。好了,现在数据库可以告一段落了。
第二步,那就是程序倒换的问题了。
$cnx = odbc_connect('taici', 'Admin', 'WSD');
记得吗?教你输入用户跟密码时候叫你记好的,就是Admin 和WSD,知道怎么做了?!
$cur= odbc_exec( $cnx, 'select * from word' );
其中的word就是其中的一个表taici
$num_row=0;
$conn=mysql_pconnect("localhost","wsd","wsd");// 连接mysql
@mysql_select_db('sms',$conn) or
die("无法连接到数据库,请与管理员联系!");//打开mysql的mydb数据库
while( odbc_fetch_row( $cur )) //从sql server的mydb库中的user表逐条取出数据,如果对数据进行选择,可在前面的select语句中加上条件判断
{
$num_row++;
$field1 = odbc_result( $cur, 1 ); // 这里的参数i(1,2,3..)指的是记录集中的第i个域,你可以有所选择地进行选取,fieldi得到对应域的值,然后你可以对fieldi进行操作
$field2 = odbc_result( $cur, 2 );
$field3 = odbc_result( $cur, 3 );
$field4 = odbc_result( $cur, 4 );

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)