SqlServer express 2005 导入 excel表的SQL语句

news/2024/7/21 7:00:46 标签: excel, sql server, express


SqlServer express 2005 导入 excel表的SQL语句

 需要在SqlServer express 2005 中 导入 excel表数据

试用三个SQL语句,出现了下面的错误信息。


insert into 表 select * from 
OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'Excel 5.0;HDR=YES;DATABASE=F:\数据.xlsx',sheet1$)

SELECT * into GuS
FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0',
'Data Source="F:\古树名木数据.xls";User ID=;Password=;Extended properties=Excel 5.0')...[sheet1$]




消息 7399,级别 16,状态 1,第 1 行

链接服务器 "(null)" 的 OLE DB 访问接口 "MICROSOFT.JET.OLEDB.4.0" 报错。提供程序未给出有关错误的任何信息。
消息 7303,级别 16,状态 1,第 1 行

无法初始化链接服务器 "(null)" 的 OLE DB 访问接口 "MICROSOFT.JET.OLEDB.4.0" 的数据源对象。



解决问题:

1、在SQL Server 外围应用配置器中启用 OpenRowSet 和 OpenDataSource函数




2、执行以上sql语句的数据库必须是本地数据库,如果为远程的数据库就会报上面的错误
3、链接字符串 Extended Properties属性的内容要以分号间隔并用双引号括起来,sheet1$ 在括号外。并且excel中文件薄名为sheet1



4、注意office的版本4.0是office2003,12.0是office2007的版本,看看是否装了驱动。

4.0驱动对应的是office2003,excel文件的后缀为xls



http://www.niftyadmin.cn/n/1318095.html

相关文章

linux下查看CPU个数、核数、运行模式以及是否支持超线程技术

1.查看物理CPU个数 #cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l 执行结果:2 2.查看逻辑CPU个数 #cat /proc/cpuinfo |grep "processor"|wc -l 执行结果:8 3.查看单个CPU的核数 #cat /proc/cpuinfo |grep "cores&…

使用Sql语句生成MD5加密字符串

select substring(sys.fn_sqlvarbasetostr(HashBytes(md5,123456)),3,32) -- SQL语句获得md5 值 HashByter(md5,123456) 拿到base类型的md5值 --sys.fn_sqlvarbasetostr 将base类型的md5值 转成字符串 -- substring 截取字符串 去掉1,2位置的0x,一直截取32个字符

制作qtopia-2.2.0和qt4文件系统

转自rootfs_qtopia_qt4.img 1. 解压rootfs_qtopia_qt4-20100816.tar.gz,得到目录rootfs_qtopia_qt4,里面内容比较大,超过了64M,再按照下面的步骤做。 2. 要使用只包含qtopia-2.2.0的文件系统,可以删除里面的目录&#…

c# 结合ADO.net实现的登陆器

string conStr "data source.;initial catalogsqldemos;user idsa;password123456;";//使用cmd参数方式防止sql注入string cmdStr string.Format("select count(*) from login where loginidUserName and loginpwdPassWord");//在数据库端比对&#xff0…

通过angularjs的ng-repeat指令看scope的继承关系

ng-repeat指令的使用方式可以参考如下代码&#xff1a; <!doctype html> <html lang"en"><head><meta charset"utf-8"><title>ng-repeat</title><script src"jquery-1.8.3.js"></script><sc…

[转]微信公众平台WeChat PHP SDK

地址&#xff1a;https://github.com/dodgepudding/wechat-php-sdk 微信公众平台php开发包,细化各项接口操作,支持链式调用 微信支付接入文档&#xff1a; https://mp.weixin.qq.com/cgi-bin/readtemplate?tbusiness/course2_tmpl&langzh_CN wechat.class.php 调用官方API…

C# ado.net匹配用户名和密码 方式2(分别验证)

//1.获取数据string name txtName.Text;string pwd txtPwd.Text;string pwdMd5 GetMD5(pwd);//2.比较用户名&#xff0c;用户名正确&#xff0c;返回密码string constr "data source.;initial catalogsqldemos;user idsa;password123456";string cmdstr " …

设置 IE 默认模式为 IE8

设置 IE 默认模式为 IE8 <meta http-equiv"X-UA-Compatible" content"IEEmulateIE8" /> posted on 2014-05-21 12:02 Alfa 阅读(...) 评论(...) 编辑 收藏 转载于:https://www.cnblogs.com/wuyifu/p/3740957.html