Home > Database > Mysql Tutorial > body text

不同格式的Access文件导入Mssql数据库中

WBOY
Release: 2016-06-07 17:46:46
Original
925 people have browsed it

到目前为止Access文件的格式有2种,一种是mdb格式文件,而另外一种是Accdb格式的文件,他们导入到Mssql数据库中方法都不一样。

1、Mdb格式导入:

SELECT  * into newtab   FROM OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',      ''C:database.mdb'';      ''admin'';'''',link)

GO

Microsoft.Jet.OLEDB.4.0为ODBC驱动,C:database.mdb为要导入的Mdb文件的物理路径,特别说明要导入的文件必须要上传到数据库所在的服务器,Link为Access表名。

2、Accdb格式导入:

SELECT * into newtab  FROM OPENROWSET(''Microsoft.Ace.OLEDB.12.0'',      ''C:aa.accdb'';      ''admin'';'''',bb)

GO

Microsoft.Ace.OLEDB.12.0为ODBC驱动号,C:aa.accdb为accdb文件的物理路径,bb为accdb表名。

3、兼容性:

Microsoft.Ace.Oledb.12.0驱动完全兼容Microsoft.Jet.Oledb.4.0驱动,反之则不成立,例如:用Microsoft.Ace.OLEDB.12.0导入Mdb格式的文件。

select  * into newtab  from Openrowset(''Microsoft.Ace.Oledb.12.0'',''c:database.mdb'';''admin'';'''',link)

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!