使用SQL在Access中创建列(数据类型=复选框) [英] Creating a column (data type = check box) in Access using SQL

查看:154
本文介绍了使用SQL在Access中创建列(数据类型=复选框)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计





您对创建列有什么想法(数据类型= bool - >显示为复选框)在Access中使用SQl?我正在用MFC,C ++编写一个工具,我需要保护数据库中的一些值。



我已经尝试了这个,我在互联网上的某个地方找到了:

Hey guys


Do you have any ideas for creating a column (data type = bool -> show as check box) in Access by using SQl? I''m wrinting a tool in MFC, C++ and I need to safe some values in a database.

I allready tried this, which I found somewhere in the internet:

ALTER TABLE table_name ADD COLUMN column_name BIT





这不是工作...





..我希望有人可以帮助我。







问候

Epanjohura



That doesn''t work...


..I hope someone can help me.



Greetings
Epanjohura

推荐答案

ALTER TABLE mytable ADD mynewcolumn YESNO
ALTER TABLE mytable ADD mynewcolumn YESNO


存储数据与呈现数据不同。因此,您的字段仍然是位类型,可以存储值:true / false,启用/禁用,是/否。



我知道,有一些之间的差异编程窗体和MFC编程 [ ^ ],但它在我们的讨论中没有任何改变。请记住,只有应用程序的用户界面(UI)负责数据表示层和控制。嵌入式机制将用户输入命令(选中的选择,按钮单击)路由到可能更新应用程序数据的内部函数。 UI控件(窗口,编辑框,复选框等)负责在每次更新后显示应用程序的数据。
Storing data is not the same as presenting data. So, your field is still "bit" type and can store values: true/false, enabled/disabled, Yes/No.

I know, there are some differences between programming windows forms and MFC programming[^], but it changes nothing in our discuss. Remember, only application''s user interface (UI) is responsible for data presentation layer and control. Embeded mechanisms route user input commands (checked selections, button clicks) to internal functions that may update the application''s data. UI controls (windows, edit boxes, checkboxes, etc.) are responsible for displaying the application''s data after each update.


这篇关于使用SQL在Access中创建列(数据类型=复选框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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