使用OleDB Jet 4.0提供程序创建Excel电子表格时CREATE TABLE的数据类型 [英] Data types for CREATE TABLE when creating an Excel Spreadsheet using OleDB Jet 4.0 provider

查看:319
本文介绍了使用OleDB Jet 4.0提供程序创建Excel电子表格时CREATE TABLE的数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我需要能够(a)将数据导出到Excel,(b)允许用户编辑它,最后(c)将编辑后的数据重新导入我的程序,如果可能的话。

我已经有工作代码使用OLEDB和Jet 4.0来创建Excel电子表格并填充它。我还有一些工作代码,可以查询Excel电子表格,了解它包含的工作表以及工作表上的列和类型。 SELECT很容易。

所以这是我的问题。在创建电子表格时,我在哪里可以找到可以在CREATE TABLE语句中使用的所有数据类型的列表?
实际上,找到所有SQL Jet 4.0的文档会很好提供者支持...)

实际创建的类型并不总是与指定的相同。这没关系,但有哪些指定类型成为哪些实际类型的文档? (例如,如果我创建一个INT类型的列,它将作为OleDbType.Double返回。)

如何在Excel电子表格中处理NULL?是否记录在任何地方?

我还需要Access的这类信息。访问可能对类型更严格,即,我希望我更有可能找回它们创建的相同类型的列。

谢谢!

解决方案

以下内容应有所帮助:

http://msdn.microsoft.com/en-us/library/ms137643.aspx
用于Access 2000的中间Microsoft Jet SQL
http:/ /www.carlprothman.net/Default.aspx?tabid=97


Hello,

I need to be able to (a) export data to Excel, (b) allow users to edit it, and finally (c) re-import the edited data back into my program, if possible.

I already have working code that uses OLEDB and Jet 4.0 to create an Excel spreadsheet and populate it. I also have working code that can query an Excel spreadsheet regarding what worksheets it contains and what the columns and types on a worksheet are. From there SELECT is easy.

So here's my question. Where can I find a list of ALL the data types that can be used in the CREATE TABLE statement, when creating the spreadsheet?

(Actually it would be nice to find documentation for all the SQL the Jet 4.0 provider supports...)

The types actually created are not always the same as specified. That is okay, but is there documentation on which specified types become which actual types? (For example if I create a column of type INT it comes back as an OleDbType.Double.)

How is NULL handled in an Excel spreadsheet? Is that documented anywhere?

I also need this sort of information for Access. Access is probably stricter about types, i.e., I expect I'd be more likely to get back columns of the same type they were created as.

Thanks!

解决方案

The following should help:

http://msdn.microsoft.com/en-us/library/ms137643.aspx
Intermediate Microsoft Jet SQL for Access 2000
http://www.carlprothman.net/Default.aspx?tabid=97


这篇关于使用OleDB Jet 4.0提供程序创建Excel电子表格时CREATE TABLE的数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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