如何将数据从VB导出到Access或Excel工作表? [英] How to export data from VB to Access or Excel sheet ?

查看:496
本文介绍了如何将数据从VB导出到Access或Excel工作表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Iam使用Visual Studio 2012,


i创建了一个vb计算应用程序(基于这些变量输入的输入数据和输出),运行我的应用程序后,我会喜欢以数据表格式保存这些输入和输出数据,所以我可以稍后再检查它们。



所以任何人都知道应用的简单方法会很棒



谢谢..,

Iam using Visual studio 2012,

i have created a vb calculations application (Input data & Output based on these variable inputs), after running my application, i would like to save these input & output data in data sheet format, so i can check them back later.

so anyone know simple method to apply that will be great

thanks..,

推荐答案

Google 是您的朋友:vb.net access database tutorial [ ^ ]。

但是,有其他选择:例如,您可以使用简单的文本文件来记录(和检索)值,或序列化 [ ^ ],或更好的数据库。
Google is your friend: "vb.net access database tutorial"[^].
However, there are alternatives: you may, for instance use a simple text file for recording (and retrieving) the values, or serialization[^], or a better database.


请先阅读我对这个问题的评论!



以下是有用链接的集合:

访问Microsoft官方来自.NET应用程序的数据 [ ^ ]

如何:创建与Access数据库的连接 [ ^ ]

演练:连接到Access数据库中的数据 [ ^ ]

在Windows应用程序中显示表单数据 [ ^ ]





全部你需要做的是写正确的q uery。 MS Access数据库引擎(和OleDb提供程序)支持将数据导出到MS Excel工作表中。

请看这些:

INSERT INTO Statement [ ^ ]



Please, read my comment to the question, first!

Here is a collection of usefull links:
Accessing Microsoft Office Data from .NET Applications[^]
How to: Create Connections to Access Databases[^]
Walkthrough: Connecting to Data in an Access Database[^]
Displaying Data on Forms in Windows Applications[^]


All you need to do is write proper query. MS Access database engine (and OleDb providers) supports export data into MS Excel worksheet.
Please, see these:
INSERT INTO Statement[^]

INSERT INTO [Sheet1


(Field1 ,Field2,... FieldN) IN ' D: \ Data\ExcelFile.xls' ' Excel 8.0'
< span class =code-keyword> SELECT Field1,Field2,... FieldN
FROM AccessTable;
(Field1, Field2, ... FieldN) IN 'D:\Data\ExcelFile.xls' 'Excel 8.0' SELECT Field1, Field2, ... FieldN FROM AccessTable;





文章使用visu谈论这个al studio express 2012不存在!只有 OleDb提供商 [ ^ ]具有自己的对象,方法等。它使您能够从MS Access数据库或MS Excel工作簿(工作表)中读取,写入和删除数据。按照链接尝试。遇到困难时,请回到这里询问详细问题。我相信,有人会帮助你。



[/ EDIT]



The article talking about that using "visual studio express 2012" does not exists! There is only OleDb provider[^] with own objects, methods, etc. It enables you to read, write and delete data from MS Access database or MS Excel workbook(worksheet). Follow the links and try. When you get stuck, come back here and ask detailed question. I believe, someone will help you.

[/EDIT]


这篇关于如何将数据从VB导出到Access或Excel工作表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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