获得一台电脑是件容易的事情,但要让Linux和Vista在同一台及其上共存则显得略微困难一些。在XP及更早的Windows电脑上,要让Windows和Linux共存这样的事几乎是全自动化的,任何主流的分发版本都能轻易做到。而到了Vista时代,一切改变了。微软抛弃了它过去的boot.ini引导加载(bootloader),而采用了新的引导装置。

  新的加载装置BCD(启动设置数据)是与韧体相分离的,它还伴随了一个新的引导选项编辑工具BCDEdit.exe,而它似乎对用户并没有那么友善。顺便提一下,我在这里谈论这些并不是像一些主要关注双引导Linux的人那样。在你无论对Vista的引导性能作出什么修改的时候,BCDEdit都会是一个让你感到头疼的问题。不幸的是,你不得不使用Vista的引导装载功能,因为对于你已经安装了一个操作系统的计算机来说,而你又打算将其保留的话,Vista不太能较好地处理一些工作。

  而在我看来,我已准备抛弃我系统中现存的Windows XP媒体中心2005 Update Rollup 2操作系统。我可以将这个系统“升级”到Vista,我确实想给Vista一个闪耀光芒的绝佳机会,但升级当前的系统看起来似乎是一个自找麻烦的路子。

  除非你手上有大把的时间,不介意陷入一些兼容性的问题,又确切地知道自己所做的事情,否则请不要“升级”到Vista,还是做一个全新的安装比较好。

  而如果你需要双引导系统,无论如何你都必须决定做一次全新的安装。你可以看到,如果你是采用“升级”一个系统的方式,你就必须在Windows XP或是2000中做这些。而如果你这么做了,你就无法再分配或是重新你格式化你的硬盘。你仅能做的就是当你从Vista的DVD光盘中引导开始Vista的安装时对你的硬盘作一些操作。因此,除非你已经有一个足够大的分区用来正在另一个操作系统,要么你最好还是选择一次全新的安装。

在一切考虑完毕之后,我在我的系统上全新安装了Vista Ultimata。我将我系统中的300GB SATA硬盘分成两个相等的分区。在Vista的这边,我有了BitLocker的驱动加密选项,但我不打算使用它。

BitLocker确实还是带给我大量的好感,特别是在如果我打算携带一台仅支持Vista的笔记本外出时,如果有什么人将它偷走,我会很高兴地知道他们无法轻易地得到我的数据。

对于我来说,则存在两个问题。第一个是它要求TPM(受信平台模块)1.1芯片或是USB驱动。而HP并没有TPM芯片,它也没有六个USB接口。然而,如果我使用一个USB驱动来保存我的BitLocker加密密钥,那么它是否就一直都不应该离开我的电脑那?而现在,这对于这个重量级的系统来说并不存在确实问题,但如果我使用笔记本,任何人只要夺走了我的电脑包那也就很可能同时获得我的USB BitLocker的密钥。

使用BitLocker来进行双引导的真正问题在于,它会组织Linux访问这个分区上的任何数据。安全专家Bruce Schneier认为“你可以将BitLocker看作是一个反Linux的东西,因为它会使双引导受挫,”但我并不这么认为。即使安装了BitLocker,Vista仍然需要一个解密的分区来引导,因此双引导应该来说还是能够完成的。只是获得处在受BitLocker保护的NTFS分区上的数据对于Linux用户来说有可能会获取不到。

在我打算开始之前对BitLocker有了最终的一个想法。微软仅是让它在Enterprise和Ultimate版本上可用。Enterprise仅对那些大量购买的用户开放的,而Ultimate是其中最贵的版本。我发现这让人感到有一些小烦恼,小企业用户们将必须升级到Ultimate来获得我认为Vista中对于企业用户最好的一点。

正如Linux的磁盘加密来说,这项功能自从版本2.6.0在几年之前出现以来,已经使用CryptoAPI内置到Linux中。如果你不想使用这种DIY的方式弄脏你的双手,你也可以使用可用GUI的开源程序,TrueCrypt来使这项工作完成。

现在,我开始安装Vista。Vista中更好的地方在于它会在你一些没有指示如何应对的硬件时发出一些警示。而不好的方面就是,它也会像所有的操作系统一样,运行它认为它知道应该如何运行的硬件,但它并没有真正的一些提示。

在m7360n上,我很快发现无论是Vista、Ubuntu或是MEPIS都不能运行所有系统的硬件。我发现Vista有一个组件是完全无法处理的,而还有一些则需要在我让它们都可用之前求助于MEPIS。

关于这些的具体问题我打算等将来谈到硬件兼容性方面再说,因此我现在可以继续谈论如何让Vista和Linux双引导成功。在我做这些之前,让我将一件事说清楚。人们总是在谈论Linux如何如何有一些设备上的问题。而这也确实是事实。然而对于Vista来说,在其开发过程中的这方面,也还是有许多的硬件问题。

在大多数情况下,Vista和MEPIS的安装都能够没有任何问题地运行。所有来自DVD的操作系统,一旦你引导这个系统,开始安装它们,你最困难的工作就是安排一个合适的时间。

在Vista中,我也确实遇到许多不禁要发问“怎么回事!”的时刻。如果你看着Windows的安装屏幕,你就会看到它会列出Home和Business作为选项,但实际上在它们之间并没有什么差别。或者说,如果有差别存在,你也肯定无法从这样的显示中指出差别来。我着实思考了好一阵子,关于人们不确定他们到底是处在家中还是办公室里,但我让这个问题从我的脑海中略过了。

当系统都安装到了电脑上后,你很快就能发现你仅能引导进入Linux,这要归功于Vista那不友善的BCD。

在此有很多方法能解决这个问题。对于基于Ubuntu的系统,像MEPIS和Kubuntu来说,它们使用的是GRUB引导程序,下面就是你应该如何进行设置。

首先,你想要转换引导,也就是众所周知的高级用户模式。MEPIS让我能够通过su命令来完成。大多数Ubuntu家族会要求你使用sudo命令。而对于我们的目的来说,在Ubuntu下通过它的sudo设置来改变引导载入将会以同一种方式工作。

现在,在大多数的Linux中,你可以用你最喜欢的文本编辑器打开file(文件)/boot(引导)/grub/menu.lst,而不是字处理程序。而在我操作的时候,则是通过一个终端的窗口。

接着,你可以在文件的底部如下输入:

title Vista
rootnoverify (hd0,1)
savedefault
makeactive
chainloader +1

接着保存并将它关闭。

在我的操作中,我将Vista放在我的第一,也是仅有的硬盘的第二个分区中,因此root的设置是“hd0,1”。如果它在我第二硬盘的第二个分区,那么它就应该是“hd1,0”。

现在,当你引导你的系统时,你首先能看到的将是MEPIS的引导屏幕。如果你想要进入Linux,你只需要就这样放着。而如果你想要引导Vista,只需要简单地选定它,接着就会进入Vistsa的BCD菜单,而你就可以进入Vista了。

如果你想要更具想象力,在系统中运行Vista、XP、Red Hat、Mac OS X、Ubuntu、Solaris和……OS/2,你则应该获取一个高端的引导管理编辑器。在这个时候,我所知道最好的能够处理Vista的BCD的东西就是来自NeoSmart Technologies的EasyBCE 1.52。这是一个仅能在Windows下使用的免费程序。

在这都结束之后,正如你所看到的,我让Vista Ultimate和SimplyMEPIS 6.01都成功地安装并运行在我的电脑上。而且整个过程大部分是非常成功的。而这两个操作系统与硬件哪些匹配哪些存在问题,那就日后再谈。

是的,看,在MEPIS的窗口中出现了一个Internet Explorer的图标。

(原文作者:Steven J. Vaughan-Nichols)

  今天,终于成功举办了2007年会!而且关键中的关键!我终于中奖了!

  自从年会开办以来,我从来没有中过奖!哪怕那么一丁点奖~但是!这个局面终于在今天改变了!呵呵!我终于中奖了!我感觉我真的是很兴奋,要不也不会这么晚了还来写Blog,呵呵。虽然说奖品的价值不是很高,但是我真的很高兴!感谢CK,抽中了我!不过还是你牛!每次都能抽到奖!而且还抽中两次一等奖!

  下午三点钟不到,我们就到了YJY酒店开始布置会场。打气球,然后把气球穿在一起,挂到背景的架子上。布置好背景,在上面挂上公司的名称。打气球,把气球挂到柱子上。这些看似很简单的工作,却够让我们忙活一阵子的了。我们买了各式各样的、大的小的、各种颜色的气球。在打气球的时候我们总结了一条,越是奇形怪状的气球,越是难打。圆的气球我们一会就打好了,但是那些有角的啊等等气球,却非常难打,打一个炸一个。还有就是也许是我打的气球最大的缘故,从拴上架子以后,就不停的在自爆,呵呵。不过看着这布置好的舞台,还是非常有自豪感的。

img_0022_resize.jpg

布置好的舞台

img_0017_resize.jpg

奖品特写

img_0018_resize.jpg

纪念品特写

  因为车的问题以及赌车等等情况,等到晚上7:50,公司的各路人马才全部到齐了。大家在都饿了不行的时候,终于可以开始吃饭了。这次的菜比去年的菜么不知道好到哪边去了,呵呵。大家吃饭、敬酒得差不多了,到了8:40,我们的演出正式开始了!其中的过程呢,我就略了,呵呵。不过其中的“你说我猜”和“你来做来我来猜”还是非常好玩的。行政部表演的“气功猜字”也非常的成功!因为时间的关系,还是压缩了很多节目。最后还是到11点才结束了所有的节目。虽然这次的一等奖,被ZMR和ZGW抽走了。不过我已经很满足了!呵呵!

 winners.jpg

中大奖的ZMR和ZGW

  回到家了,还是很兴奋。就写下了这篇Blog!让大家都来和我一起高兴吧!

昨天,30日,是我的生日。日子过得也真快啊,一晃就又长了一岁了。回想一下,酸甜苦辣,真不知怎么说才好。

真有点感觉象在混日子,工作这几年也没有什么大的变化。也许~呵呵,我属于保守派吧。

这个生日也是我的第一个没有蜡烛的生日。小弹簧和我在晚饭吃了“刘一手”以后,原本打算去买“订婚戒指”的,呵呵。但是到了昆百大以后却发现,那里竟然只有白金的戒指,呵呵。就只有放弃了。之后呢,就在街上徘徊了进了“良木缘咖啡”。据小弹簧介绍,这个“良木缘”是一伙成都的大学生开的咖啡点。刚起步的时候很难,很难,但是到了现在,已经发展成到连锁店,人家已经成了拥有百万家产的人了。呵呵,说着说着,还真有点羡慕。什么时候我才能拥有这样一个成功的事业呢?

今天发生了一些什么事呢?说来也巧,Microsoft Vista今天发布了。和我的生日同天,真不知为什么这么巧。同时,今天九城也宣布拿到了WOW资料的经营权。

感谢小弹簧以及祝福我生日快乐的朋友:tutu、mm、lpy、等等 🙂

 

 

2B or not 2B To Be Or Not To Be
4ever Forever
A/S/L Age/Sex/Location
AFAIC As Far As I’m Concerned
AFAIK As Far As I Know
AFK Away From Keyboard
AIAMU And I’m A Monkey’s Uncle
AISI As I See It
AKA Also Known As
AMBW All My Best Wishes

ANFAWFOWS And Now For A Word Word From Our Web Sponsor
AOTS All Of The Sudden
ASAFP As Soon As "Friggin" Possible
ASAP As Soon As Possible
ATST At The Same Time

AWGTHTGTTA Are We Going To Have To Go Through This Again
AWGTHTGTTSA Are We Going To Have To Go Through This Sh Again
AYSOS Are You Stupid Or Something
B4 Before
B4N Bye For Now

BBFBBM Body By Fisher, Brains by Mattel
BBIAB Be Back In A Bit
BBIAF Be Back In A Few
BBL Be Back Later
BBN Bye Bye Now

BCNU Be Seein’ You
BFD Big Fing Deal
BFN Bye For Now
BHOF Bald Headed Old Fart
BIF Basis In Fact

BITD Back In The Day
BM Byte Me
BMOTA Byte Me On The Ass
BNF Big Name Fan
BOHICA Bend Over Here It Comes Again

BR Bathroom
BRB Be Right Back
BRT Be Right There
BS Big Smile
BT Byte This

BTDT Been There Done That
BTSOOM Beats The Sh Out Of Me
BTW By The Way
BTWBO Be There With Bells On
BWDIK But What Do I Know?

BWO Black, White or Other
CIAO Goodbye (in Italian)
CID Consider It Done
CIO Check It Out
CIS CompuServe Information Service

CMF Count My Fingers
Cof$ Church of Scientology
CRAFT Can’t Remember a Fing Thing
CRAWS Can’t Remember Anything Worth A Sh
CSL Can’t Stop Laughing

CTC Choaking The Chicken
CUL8R See You Later
CWYL Chat With You Later
CYA Cover Your Ass
CYL See You Later

DBEYR Don’t Believe Everything You Read
DD Due Diligence
DDD Direct Distance Dial
DETI Don’t Even Think It
DGT Don’t Go There

DHYB Don’t Hold Your Breath
DILLIGAD Do I Look Like I Give A damn
DILLIGAS Do I Look Like I Give A Sh
DKDC Don’t Know Don’t Care
DLTM Don’t Lie To Me

DQYDJ Don’t Quit You’re Day Job
DRIB Don’t Read If Busy
DYSTSOTT Did You See The Size Of That Thing
EG Evil Grin
EOM End Of Message

ESO Equipment Smarter than Operator
F2F Face-to-Face
FBKS Failure Between Keyboard and Seat
FE Fatal Error
FF&PN Fresh Fields and Pastures New

FO F Off
FOAF Friend Of A Friend
FTASB Faster Than A Speeding Bullet
FTL Faster Than Light
FTTB For The Time Being

FUBAR Fed Up Beyond All Recognition
FUBB Fed Up Beyond Belief
FUD (Spreading) Fear, Uncertainty, and Disinformation
FWIW For What It’s Worth
FYA For Your Amusement

FYI For Your Information
FYM For Your Misinformation
GAL Get A Life
GG Good Game or Gotta Go
GIGO Garbage In, Garbage Out

GIWIST Gee, I Wish I’d Said That
GL Good Luck
GLYASDI God Loves You And So Do I
GMTA Great Minds Think Alike
GNBLFY Got Nothing But Love For You

GR&D Grinning Running And Ducking
GR8 Great
GRRRR "Growling"
GSOAS Go Sit On A Snake
GTG Got To Go

GTGB Got To Go, Bye
GTGP Got To Go Pee
GTH Go To Hell
GTSY Glad To See Ya
GYPO Get Your Pants Off

HAGO Have A Good One
HAK Hugs And Kisses
HB Hurry Back
HD Hold
HHO1/2K Ha Ha, Only Half Kidding

HHOK Ha Ha, Only Kidding
HIOOC Help! I’m Out of Coffee
HTH Hope This (That) Helps
HUA Heads Up Ace
HUYA Head Up Your A

IAC In Any Case
IAE In Any Event
IANAC I Am Not A Crook
IANAL I Am Not A Lawyer
IBT In Between Technology

IBTD I Beg To Differ
IC In Character
IDGAF I Don’t Give A F
IDGI I Don’t Get It
IDK I Don’t Know

IDKY I Don’t Know You
IDST I Didn’t Say That
IDTS I Don’t Think So
IFAB I Found A Bug
IFU I Fed Up

IGGP I Gotta Go Pee
IIIO Intel Inside, Idiot Outside
IIMAD If It Makes An(y) Difference
IIRC If I Remember Correctly
IIWM If It Were Me

ILICISCOMK I Laughed, I Cried, I Spat/Spilt Coffee/Crumbs/Coke
On My Keyboard
ILY I Love You
IMHO In My Humble Opinion
IMNSHO In My Not So Humble Opinion

IMO In My Opinion
INMP It’s Not My Problem
INPO In No Particular Order
IOH I’m Outta Here
IOW In Other Words

IRL In Real Life
ISS I Said So
ITM In The Money
IYKWIM If You Know What I Mean
IYSS If You Say So

J/C Just Checking
J/K Just Kidding!
J/W Just Wondering
JAFO Just Another Fing Onlooker
KFY Kiss For You

KISS Keep It Simple Stupid
KIT Keep In Touch
KMA Kiss My Ass
KWIM Know What I Mean
KYPO Keep Your Pants On

L8R Later
LD Long Distance
LDTTWA Let’s Do The Time Warp Again
LLTA Lots And Lots Of Thunderous Applause
LMAO Laughing My Ass Off

LMK Let Me Know
LOL Laughing Out Loud -or- Lots of Luck (or Love)
LTIC Laughing ’Til I Cry
LTNS Long Time No See
LYL Love Ya Lots

LYLAS Love You Like A Sister
MHOTY My Hat’s Off To You
MM Market Maker
MorF Male or Female?
MOTD Message Of The Day

MOTSS Members Of The Same Sex
MTFBWY May The Force Be With You
MWBRL More Will Be Revealed Later
MYOB Mind Your Own Business
NAK Nursing At Keyboard

NAZ Name, Address, Zip (also means Nasdaq)
NBD No Big Deal
NBIF No Basis In Fact
NFI No Fing Idea
NFW No Fing Way

NIFOC Nude In Front Of The Computer
NM Never Mind
NMP Not My Problem
NOYB None Of Your Business
NP No Problem

NQOCD Not Quite Our Class Dear
NRG Energy
NRN No Reply Necessary
NYCFS New York City Finger Saluet
OAUS On An Unrelated Subject

OBTW Oh By The Way
OIC Oh, I see
OMDB Over My Dead Body
OMG Oh My Gosh
OMIK Open Mouth, Insert Keyboard

ONNA Oh No, Not Again
OOC Out Of Character
OOTB Out Of The Box -or- Out Of The Blue
OT Off Topic
OTOH On the Other Hand

OWTTE Or Words To That Effect
OZ stands for "Australia"
PEBCAK Problem Exists Between Chair And Keyboard
PIMP Peeing In My Pants
PITA Pain In The Ass

PLS Please
PMFJI Pardon Me For Jumping In
PO Piss Off
POV Point of View
RBTL Read Between The Lines

RL Real Life
RLF Real Life Friend
RMLB Read My Lips Baby
RMMM Read My Mail Man!
RN Right Now!

ROTFL Rolling On The Floor Laughing
ROTFLMAO Rolling On The Floor Laughing My Ass Off
ROTM Right On The Money
RSN Real Soon Now
RTFM Read The Fing Manual

RTK Return To Keyboard
RTM Read The Manual
RU Are You?
SBTA Sorry, Being Thick Again
SH Sh Happens

SITD Still In The Dark
SNAFU Situation Normal, All Fed Up
SOL Sh Out of Luck
SorG Straight or Gay?
SSDD Same Sh Different Day

STFU Shut The F Up
STM Spank The Monkey
STYS Speak To You Soon
SUYF Shut Up You Fool
SWAG Scientific Wild Ass Guess

SWAK Sent (or Sealed) With A Kiss
SWDYT So What Do You Think?
TAH Take A Hike
TANSTAAFL There Ain’t No Such Thing As A Free Lunch
TARFU Things Are Really Fed Up

TDTM Talk Dirty To Me
TEOTWAWKI The End Of The World As We Know It
TFN Thanks For Nothin’
THX or TX or THKS Thanks
TIA Thanks In Advance

TIAIL Think I Am In Love
TIC Tongue In Cheek
TLA Three Letter Acronym
TLGO The List Goes On
TM Trust Me

TMI Too Much Information
TMTOWTDI There’s More Than One Way To Do It
TPTB The Powers That Be
TSR Totally Stuck in RAM
TTFN Ta Ta For Now

TTT That’s The Ticket -or- To The Top
TTYL Talk To You Later
TWHAB This Won’t Hurt A Bit
TY Thank You
TYVM Thank You Very Much

unPC unPolitically Correct
URYY4M You Are Too Wise For Me
VFM values For Money
WAG Wild Ass Guess
WAI What An Idiot

WB Welcome Back
WCA Who Cares Anyway
WDYS What Did You Say?
WDYT What Do You Think?
WE Whatever

WEG Wicked Evil Grin
WG Wicked Grin
WGAFF Who Gives A Flying F
WIIFM What’s In It For Me?
WIT Wordsmith In Training

WITFITS What in the F is this Sh
WOG Wise Old Guy
WRT With Regard To
WTF What The F
WTG Way To Go!

WTSDS Where The Sun Don’t Shine
WYP What’s Your Problem?
WYRN What’s Your Real Name?
WYS Whatever You Say
WYSIWYG What You See Is What You Get

WYT Whatever You Think
YA Yet Another
YA yaya Yet Another Ya-Ya (as in yo-yo)
YAFIYGI You Asked For It You Got It
YDKM You Don’t Know Me

YGBK You Gotta Be Kiddin’
YMMV Your Mileage May Vary
YNK You Never Know
YOYO You’re On Your Own
YR Yeah Right

YSYD Yeah, Sure You Do
YTTT You Telling The Truth?
YYSSW Yeah Yeah Sure Sure Whatever

  编辑注:学会了这些东西,您将基本可以独立完成ASP对数据库的所有操作。

  ASP连接数据库的11种方法——本文总结了使用ASP链接各种数据库的方法:

  1.Access数据库的DSN-less连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adoconn.Open"Driver={Microsoft Access Driver(*.mdb)};DBQ="& _

  Server.MapPath("数据库所在路径")

  2.Access OLE DB连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"Provider=Microsoft.Jet.OLEDB.4.0;"& _

  "Data Source=" & Server.MapPath("数据库所在路径")

  3.SQL server连接方法:

  set adocon=server.createobject("adodb.recordset")

  adocon.Open"Driver={SQL Server};Server=(Local);UID=***;PWD=***;"& _

  "database=数据库名;"

  4.SQL server OLE DB连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"provider=SQLOLEDB.1;Data Source=RITANT4;"& _

  "user ID=***;Password=***;"& _

  "inital Catalog=数据库名"

  5.Oracle 连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"Driver={microsoft odbc for oracle};server=oraclesever.world;uid=admin;pwd=pass;"

  6.Oracle OLE DB 连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"Provider=OraOLEDB.Oracle;data source=dbname;user id=admin;password=pass;"

  7.dBase 连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"Driver={microsoft dbase driver(*.dbf)};driverid=277;dbq=————;"

  8.mySQL 连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"Driver={mysql};database=yourdatabase;

  uid=username;pwd=yourpassword;option=16386;"

  9.Visual Foxpro 连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"Driver={microsoft Visual Foxpro driver};sourcetype=DBC;sourceDB=*.dbc;Exclusive=No;"

  10.MS text 连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"Driver={microsoft text driver(*.txt; *.csv)};dbq=—–;"&_

  "extensions=asc,csv,tab,txt;Persist SecurityInfo=false;"

  11.MS text OLE DB 连接方法:

  set adocon=Server.Createobject("adodb.connection")

  adocon.open"Provider=microsof.jet.oledb.4.0;data source=your_path;"&_

  "Extended Properties‘text;FMT=Delimited‘"

  <二>常用的四种SQL命令:

  1.查询数据记录(Select)

  语法:Select 字段串行 From table Where 字段=内容

  例子:想从book表中找出作者为"cancer"的所有记录,SQL语句便如下:

  select * from book where author=’cancer’

  "*"是取出book表所有的字段,如查询的字段值为数字,则其后的"内容"便无须加上单引号,如是日期,则在Access中用(#)包括,而在SQL server中则用(’)包括,

  如:

  select * from book where id=1

  select * from book where pub_date=#2002-1-7# (Access)

  select * from book where pub_date=’2002-1-7’ (SQL Server)

  提示:

  日期函数to_date不是标准sql文,不是所有的数据库适用,所以大家在使用的时候要参考数据库具体语法

  另外如果是查询传入的变量,则如下:

  strau=request.form("author")

  strsql="select * from book where author=’"&strau&"’"

  如果查询的是数字,则:

  intID=request.form("id")

  strsql="select * from book where id="&intID

  在很多数据库中,如:oracle,上面的语句是可以写成:

  strsql="select * from book where id=‘"&intID&"‘"

  但是字符型一定不能按照数字格式写,需要注意。

  2.添加记录(Insert)

  语法:

  Insert into table(field1,field2,….) Values (value1,value2,….)

  例子:添加一作者是"cancer"的记录入book表:

  insert into book (bookno,author,bookname) values (’CF001’,’cancer’,’Cancer无组件上传程序’)

  同样,如果用到变量就如下:

  strno=request.form("bookno")

  strau=request.form("author")

  strname=request.form("bookname")

  strsql="insert into book (bookno,author,bookname) values (’"&strno&"’,’"&strau&"’,’"&strname&"’)"

  3.用Recordset对象的Addnew插入数据的方法:

  语法:

  rs.addnew

  rs("field1").value=value1

  rs("field2").value=value2

  …

  rs.update

  4.修改数据记录(Update)

  语法:

  update table set field1=value1,field2=value2,…where fieldx=valuex

  例子:

  update book set author=’babycrazy’ where bookno=’CF001’

  如果用到变量就如下:

  strno=request.form("bookno")

  strau=request.form("author")

  strsql="update book set author=’"&strau&"’ where bookno=’"&strno"’"

  5.Recordset对象的Update方法:

  语法:

  rs("field1").value=value1

  rs("field2").value=value2

  …

  rs.update

  注意:使用语法3和语法5的时候,一定要注意字段的类型(尤其是日期型)一致,否则出错的几率非常的高。

  例子:

  strno=request.form("bookno")

  strau=request.form("author")

  set adocon=server.createobject("adodb.connection")

  adocon.open "Driver={Microsoft Access Driver(*.mdb)};DBQ=" & _

  Server.Mappath=("/cancer/cancer.mdb")

  strsql="select * from book where bookno=’"&strno&"’"

  set rs=server.createobject("adodb.recordset")

  rs.open strsql,adconn,1,3

  if not rs.eof then ’如果有此记录的话

  rs("author").value=strau

  rs.update

  end if

  rs.close

  set rs=nothing

  adocon.close

  set adocon=nothing

  6.删除一条记录(Delete)

  语法:

  Delete table where field=value

  例子:删除book表中作者是cancer的记录

  delete book where author=’cancer’

  (注意:如果book表中author字段的值为cancer的记录有多条,将会删除所有author为cancer的记录)

  好了,学会了用这些操作,大家在用asp操作数据库的时候,该是没有什么问题了。

  准备工作:

  1.安装OCA。运行Developer的安装盘,选择自定义安装,选择Oracle Open Client Adapter for ODBC安装。

  2.在数据源(ODBC)中添加DSN。控制面板->管理工具->数据源(ODBC),选择“用户DSN”,添加要进行操作的Access的文件。在“高级”选项里,填上“登录名称”和“密码”(很重要,在程序中会用到)。

  下面以实际例子来说明:

  假设在Oracle中和Access中都有一个student表,表中字段相同(name char(10) ,age number(2)),在准备工作2中的“数据源名”为test,“登录名称”和“密码”都为user。

  下面为从Oracle导出到Access的procedure:

以下是引用片段:
  PROCEDURE oracle_to_access IS
  connection_id EXEC_SQL.ConnType;
  action_cursor EXEC_SQL.CursType;
  ignore PLS_INTEGER;
  t_name student.name%type;
  t_age student.age%type;
  cursor temp_cursor is select * from student;
  BEGIN
  connection_id:= EXEC_SQL.OPEN_CONNECTION(‘user/user@odbc:test‘);
  action_cursor := EXEC_SQL.OPEN_CURSOR(connection_id);
  EXEC_SQL.PARSE(connection_id, action_cursor,‘delete * from student‘);
  ignore := EXEC_SQL.EXECUTE(connection_id, action_cursor);
  EXEC_SQL.CLOSE_CURSOR(connection_id,action_cursor);
  open temp_cursor;
  export_count := 0;
  action_cursor := EXEC_SQL.OPEN_CURSOR(connection_id);
  EXEC_SQL.PARSE(connection_id, action_cursor,‘INSERT INTO student(name,age) values(:1,:2)‘);
  loop
  fetch temp_cursor into t_name,t_age;
  exit when temp_cursor%notfound;
  EXEC_SQL.BIND_VARIABLE(connection_id,action_cursor, ‘:1‘, t_name);
  EXEC_SQL.BIND_VARIABLE(connection_id,action_cursor, ‘:2‘, t_age);
  ignore := EXEC_SQL.EXECUTE(connection_id, action_cursor);
  end loop;
  close temp_cursor;
  EXEC_SQL.PARSE(connection_id, action_cursor,‘commit‘);
  ignore := EXEC_SQL.EXECUTE(connection_id,action_cursor);
  EXEC_SQL.CLOSE_CURSOR(connection_id,action_cursor);
  EXEC_SQL.CLOSE_CONNECTION(connection_id);
  EXCEPTION
  WHEN EXEC_SQL.PACKAGE_ERROR THEN
  IF EXEC_SQL.LAST_ERROR_CODE(connection_id) != 0 THEN
  message(‘数据导出至ACCESS失败: ‘ || TO_CHAR(EXEC_SQL.LAST_ERROR_CODE(connection_id)) || ‘: ‘ || EXEC_SQL.LAST_ERROR_MESG(connection_id));
  END IF;
  IF EXEC_SQL.IS_CONNECTED(connection_id) THEN
  IF EXEC_SQL.IS_OPEN(connection_id,action_cursor) THEN
  EXEC_SQL.CLOSE_CURSOR(connection_id,action_cursor);
  END IF;
  EXEC_SQL.CLOSE_CONNECTION(connection_id);
  END IF;
  END;
  下面为从Access导出到Oracles的procedure:
  PROCEDURE Access_to_oracle IS
  connection_id EXEC_SQL.ConnType;
  action_cursor EXEC_SQL.CursType;
  ignore PLS_INTEGER;
  t_name student.name%type;
  t_age student.age%type;
  BEGIN
  connection_id := EXEC_SQL.OPEN_CONNECTION(‘user/user@odbc:test‘);
  action_cursor := EXEC_SQL.OPEN_CURSOR(connection_id);
  delete from student;
  EXEC_SQL.PARSE(connection_id, action_cursor,‘select name,age from student‘);
  ignore := EXEC_SQL.EXECUTE(connection_id, action_cursor);
  exec_sql.define_column(connection_id,action_cursor,1,t_name,10);
  exec_sql.define_column(connection_id,action_cursor,2,t_age);
  ignore := EXEC_SQL.EXECUTE(connection_id, action_cursor);
  while(exec_sql.fetch_rows(connection_id,action_cursor)>0)
  loop
  exec_sql.column_value(connection_id,action_cursor,1,t_name);
  exec_sql.column_value(connection_id,action_cursor,2,t_age);
  insert into test(name,age) values(t_name,t_age);
  end loop;
  commit;
  EXEC_SQL.CLOSE_CURSOR(connection_id,action_cursor);
  EXEC_SQL.CLOSE_CONNECTION(connection_id);
  EXCEPTION
  WHEN EXEC_SQL.PACKAGE_ERROR THEN
  IF EXEC_SQL.LAST_ERROR_CODE(connection_id) != 0 THEN
  message(‘数据导入至ORACLE失败: ‘ || TO_CHAR(EXEC_SQL.LAST_ERROR_CODE(connection_id)) || ‘: ‘ || EXEC_SQL.LAST_ERROR_MESG(connection_id));
  END IF;
  IF EXEC_SQL.IS_CONNECTED(connection_id) THEN
  IF EXEC_SQL.IS_OPEN(connection_id,action_cursor) THEN
  EXEC_SQL.CLOSE_CURSOR(connection_id,action_cursor);
  END IF;
  EXEC_SQL.CLOSE_CONNECTION(connection_id);
  END IF;
  END;

  注意:EXEC_SQL.BIND_VARIABLE中绑定的变量只能是以下三种类型:NUMBER,DATE,VARCHAR2。对于Access中的“是/否”的布尔型变量,可以用NUMBER类型的1和0来表示。如果Access中的表名或者字段名中有空格,在写SQL语句的时候可以用双引号把表名或者字段名包括起来,如:本例中如果Access中表名为student detail,字段名分别为student name和student age,那插入数据的SQL语句为:insert into “student detail”(“student name”,”student age”) values(:1,:2).

现在网上充斥了各种各样的信息,上网的时候随随便便就很容易被这些信息所吸引。从而开始了在网上闲逛,忘记了原来上网的目的~时间,就这样流逝了……

所以我决定Do things on purpose,有目的的做事,而不要被网上的各种信息吸引,免得宝贵的时间就这样流逝掉。

今天好不容易腾出时间来仔细看看Blog,发现这个月的Blog数量是有史以来最少的,呵呵。忙!就一个字!

这几天在准备公司年会,顺便透露一下公司年会的情况吧,呵呵。

我们的年会呢,感觉是一年不如一年了。感觉最好的,还是04年在戴安娜红酒坊举行的那一次。饭菜也好,节目也非常精彩,游戏也很到位,当然最重要的是奖品也非常吸引人,呵呵。印象最深的是因为ZH马上就要结婚了,大家就排队敬他酒,结果队伍排的转弯!而且最后他还是一点酒都没有喝。真是经典中的经典啊!

今年的年会呢,BOSS不在KM,所以我们就放开玩啦!哈哈!地点是定在2月2日在怡景园举行,地址就在滇池路西贡码头附近。用餐呢就是自助餐啦,免得吃不饱引起争执,呵呵。因为距离比较远,所以我们安排了两辆大巴进行接送。这几天我们已经把会场、舞台等等都已经搞定了。包括舞台帖字等等都搞定了,还搞定了奖品!我就来说一说今年的奖品吧!

一等奖 2名 奖品: 组合音响一套
二等奖 4名 奖品: 美的电磁炉崔具一套
三等奖 8名 奖品: 森海塞耳HD201监听耳机一副

表演奖 若干 奖品: 待定
纪念奖 若干 奖品: 待定

怎样?奖品吸引人吧?呵呵。我呢……抽奖是绝对抽不到我的,这一点我是很有信心的。好东西都是从我手上经过,然后就到了别人手上了。:( 这可是有证据的!年会开到现在,已经开了三次了,这次是第四次了。三次当中,奖品无数,但是我都是什么都没有!唉…… 所以这次在买奖品的时候我就自己帮自己买了一个HD201,哈哈!

 

指定特定用户登录VNC:


The VNC server can be automatically started when the system boots via the vncserver service. However, before this service will work, some preparatory set up needs to be done.

First, edit the /etc/sysconfig/vncservers file to include the users you want to run VNC servers for. Add a line to that file as follows:

VNCSERVERS="N:user"

Where N is the number of the display you want the VNC server to run on and user is the username you want the server to run as. Multiple displays and users can be specified by placing a space between them, as follows:

VNCSERVERS="N:user1 Y:user2"

Note that if you are using the X Window System, display 0 cannot be used for VNC as it is already being used by X.

For each user you specify, a VNC password needs to be set. VNC passwords are completely separate from the normal system password for that account. A user can set their VNC password by executing the vncpasswd command. For example:

$ vncpasswd
Password:
Verify:

By default, VNC starts up only a simple window manager and a terminal window. If you would like to have the full Red Hat environment, create ~username/.vnc/xstartup and include the following lines:

#!/bin/bash
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

Lastly, ensure that the resulting file has the execute bit set:

# chmod 755 ~username/.vnc/xstartup

In order to start the vncserver service immediately, run the following command:

# service vncserver start

For exmaple:

# service vncserver start
Starting VNC server: 1:user1 

In order for the vncserver service to start during the boot sequence, run the following command:

# chkconfig vncserver on

Note this command will simply return a command prompt. For example:

# chkconfig vncserver on
# chkconfig --list vncserver
vncserver       0:off   1:off   2:on    3:on    4:on    5:on    6:off

启动VNC Server控制Native X Server:

If you configure VNC to control the native X server of a system, you can interact with the console while sitting at the system or from any other system that can run a VNC viewer program. Be sure to do this initial VNC implementation during a maintenance window for your server in case VNC does not work correctly with your video card.

Warning: The following solution is not graceful and should be tested throughly before utilizing it on a production system.

To set up VNC to control the native X server, follow these steps:

  1. On the system you want to control with VNC, run the program vncpasswd as root to set a VNC password. You will use this password when connecting with vncviewer or another VNC remote control program.
  2. Edit the file /etc/X11/XF86Config to include the following commands. The XF86Config file is divided into parts that begin with the word Section and end with the word EndSection. You will need to add the following lines to the indicated section, making sure they come before the EndSection tag for that particular section.

    Red Hat Enterprise Linux 4 and above uses the XOrg implementation instead of XFree86. Edit the file /etc/X11/xorg.conf instead of XF86Config

    In the section called Module, add this line:

    Load "vnc"

    Make sure this is on a new line before EndSection.

    In section called Screen, add this line:

    Option "passwordFile" "/root/.vnc/passwd"

    Make sure this is on a new line before EndSection.

After you have rebooted your machine, VNC will load automatically each time you enter runlevel 5 (graphical mode). If you do not want to reboot now, you can make the changes active by logging out of graphical mode and pressing Ctrl+Alt+Backspace to restart the X server.

Because you are connecting to the root console, you do not have to type a number after the machine name or IP address when connecting to this computer with a VNC viewer.


让VNC走SSH:

To tunnel VNC connections over SSH, you must have a real system account on the machine running the VNC server. You must also know what display the VNC server is running on (which can be found in the /etc/sysconfig/vncservers file). Once you have these pieces of information, connect to the VNC server with the following SSH command:

ssh -L 590X:127.0.0.1:590X -N -f -l username servername

Replace the X‘s with the display number the VNC server is running on. For example, if the VNC server was running on display 1, you would specify 5901.

In your VNC client, instead of connecting directly to the VNC server, connect to "127.0.0.1:590X", again replacing X with the appropriate display number. This will tunnel the connection over SSH, providing greatly enhanced security.