请问在ADO中能够直接连接文本文档数据库吗?

sandrowjw 2003-11-20 11:02:07
就是Driver={Microsoft Text Driver (*.txt;*.cvs)},这个格式的连接字符串,用ADO连接,现在总是提示我“没有输入驱动程序类型或者数据源”。
请问ADO是否支持这种格式的连接,如果支持的话我应该怎么做。
...全文
38 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
MicoInNet 2003-11-24
  • 打赏
  • 举报
回复
mark
AkiraChing 2003-11-21
  • 打赏
  • 举报
回复
ODBC Driver for Text

strConnection = _T("Driver={Microsoft Text Driver (*.txt; *.csv)};"
"Dbq=C:\\DatabasePath\\;Extensions=asc,csv,tab,txt;");

If you are using tab delimited files, you must to create the schema.ini file, and you must to inform the Format=TabDelimited option in your connection string

Note: You must to specify the filename in the sql statement....
For Example:

CString strQuery = _T("Select Name, Address From Clients.csv");



Connecting to a Text File using the JET OLE DB Provider: strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\DatabasePath\\;"
"Extended Properties=\"\"text;"
"HDR=Yes;FMT=Delimited;\"\";");

Note: You must to specify the filename in the sql statement....
For Example:

CString strQuery = _T("Select Name, Address From Clients.txt");

see
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q262537


cdwy411 2003-11-21
  • 打赏
  • 举报
回复
哈哈!
就是么?
sandrowjw 2003-11-21
  • 打赏
  • 举报
回复
搞明白是怎么回事了,这个字符串挺严格的
Driver={Microsoft Text Driver (*.txt; *.cvs)},我写成了
Driver={Microsoft Text Driver (*.txt;*.cvs)},结果就不行了
sandrowjw 2003-11-21
  • 打赏
  • 举报
回复
也好,就散分吧,不过分是不多
spwnihao 2003-11-21
  • 打赏
  • 举报
回复
hoho~~
spwnihao 2003-11-21
  • 打赏
  • 举报
回复
我来接分
sandrowjw 2003-11-21
  • 打赏
  • 举报
回复
有趣啊,把Driver改成DRIVER就好了。

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧