如何使用C语言将文本文档转换为Ms Access数据库表? [英] How Do I Convert Text Document Into Ms Access Database Sheet Using C Language?

查看:122
本文介绍了如何使用C语言将文本文档转换为Ms Access数据库表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的文字格式如下:

shopping = 2

dskjsg = 3

sdfdbhs = 96

fgshbsfb = 45





i想要数据库中的两行,一行包含名称和其他值。

i have text document in format like this:
shopping=2
dskjsg=3
sdfdbhs=96
fgshbsfb=45


i want two row in database, one containing name and other its value.

推荐答案

读取并解析文本文档并创建一个SQL语句,它将执行您需要的操作。
read and parse the text document and create a SQL statement which will perform your needed actions.


首先,您必须实现一个解析器解析文本文件。使用Access ODBC Driver包括sqlext.h。



转到Wes Aday提到的页面。您应该使用直接ODBC方法。请参阅标题直接ODBC示例下的代码。



注意:该页面声称该方法仅适用于32位Windows。您使用的是64位Windows操作系统吗?如果使用64位操作系统,则应切换到C ++并使用ADO等替代方法。
First of all, you have to implement a parser to parse the text file. Use Access ODBC Driver by including "sqlext.h".

Go to the page what Wes Aday mentioned. You should use "Direct ODBC Method". See the code under heading "Direct ODBC Example".

Note: The page claims that the method is only available for 32 bit Windows. Are you using 64 bit Windows Operating System? If you use 64 bit OS, you should switch over to C++ and use some alternatives like ADO.


这篇关于如何使用C语言将文本文档转换为Ms Access数据库表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆