打开另一个数据库并更改数据类型 [英] Open another database and change a data type

查看:75
本文介绍了打开另一个数据库并更改数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

A97。


我希望能够使用代码打开更改另一个数据库中

表中字段的数据类型 - 可以这样做了吗?


非常感谢。

基思。

A97.

I want to be able to use code to open change the data type of a field in a
table in another database - can this be done?

Many thanks.
Keith.

推荐答案

Keith Wilby< ke ********* @ AwayWithYerCrap.com>写在

新闻:Xn ************************ @ 10.15.188.42:
Keith Wilby <ke*********@AwayWithYerCrap.com> wrote in
news:Xn************************@10.15.188.42:
A97。

我希望能够使用代码打开更改另一个数据库中
表中字段的数据类型 - 可以这样做吗?

非常感谢。
Keith。
A97.

I want to be able to use code to open change the data type of a field in a
table in another database - can this be done?

Many thanks.
Keith.




DAO.DBEngine(0)(0).Execute" ALTER TABLE" _

& [D:\ My Documents \Access\db1.mdb] .tbl2002Transactions" _

& ALTER COLUMN fldDescription TEXT


将字段类型从二进制更改为文本。


-

Lyle

(电子邮件参考 http://ffdba.com /contacts.htm


Lyle Fairfield< Mi ************ @ Invalid.Com>写道:
Lyle Fairfield <Mi************@Invalid.Com> wrote:
我希望能够使用代码打开在另一个数据库的表中更改字段的数据类型 - 这可以吗?

非常感谢。
基思。
I want to be able to use code to open change the data type of a field
in a table in another database - can this be done?

Many thanks.
Keith.



DAO.DBEngine(0)(0)。执行ALTER TABLE ; _
& [D:\ My Documents \Access\db1.mdb] .tbl2002Transactions" _
& ALTER COLUMN fldDescription TEXT

将字段类型从二进制更改为文本。



DAO.DBEngine(0)(0).Execute "ALTER TABLE " _
& "[D:\My Documents\Access\db1.mdb].tbl2002Transactions " _
& "ALTER COLUMN fldDescription TEXT"

Changes field type from binary to text.




非常感谢Lyle,我现在就试试。

:-)



Many thanks Lyle, I''ll try that now.
:-)


莱尔,我的印象是你只能在Jet 4中使用ALTER COLUMN,

然后不用DAO。这是正确的吗?


解决方法,基思,将是:

1.更改表...创建列

2.更新......(将数据复制到新栏目中)

3.更改表格...下拉列


-

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" Lyle Fairfield" <弥************ @ Invalid.Com>在消息中写道

news:Xn ******************* @ 130.133.1.4 ...
Lyle, I had the impression that you could only use ALTER COLUMN in Jet 4,
and then not with DAO. Is that correct?

The workaround, Keith, would be to:
1. ALTER TABLE ... CREATE COLUMN
2. UPDATE ... (to copy the data into the new column)
3. ALTER TABLE ... DROP COLUMN

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
Keith Wilby <柯********* @ AwayWithYerCrap.com>在
新闻中写道:Xn ************************ @ 10.15.188.42:
Keith Wilby <ke*********@AwayWithYerCrap.com> wrote in
news:Xn************************@10.15.188.42:
A97。

我希望能够使用代码打开更改另一个数据库中
a表中字段的数据类型 - 可以这样做吗?

非常感谢。
Keith。
A97.

I want to be able to use code to open change the data type of a field in a table in another database - can this be done?

Many thanks.
Keith.



DAO.DBEngine(0)(0).Execute" ALTER TABLE" _
& [D:\ My Documents \Access\db1.mdb] .tbl2002Transactions" _
& ALTER COLUMN fldDescription TEXT

将字段类型从二进制更改为文本。



DAO.DBEngine(0)(0).Execute "ALTER TABLE " _
& "[D:\My Documents\Access\db1.mdb].tbl2002Transactions " _
& "ALTER COLUMN fldDescription TEXT"

Changes field type from binary to text.



这篇关于打开另一个数据库并更改数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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