Thursday, June 28, 2007

Wealthtoolbox (earn your first $100 soon just one click)

http://www.wealthtoolbox.com
Just click the link above and sign up with your paypal email address, you will get $100 at once.Then most oftenly go to your account ,you will find that they do give you $5 each time you login. Please don't be histate,you may lose the chance to get your first $ 100from the web.Though you hope can earn money on web by writing blog,and it is another chance you can do it just by once sign up and visit the web with your account.If you don't believe you can check it with a email that don't have any relationship with your private information. though they did not get any information from you .It is a trick again, It suppose to that they will just get your email adress and it is paypal true account. Now it is really the account you sign for paypal, do you think it it goes to your pocket without even pray for? i don't think so, so if you are not mind , can just try the like above and just sign use your useless email address. it will be much safe than use paypal account.
and you can also read this article about it .http://turnonepoundintoonemillion.blogspot.com
but it will be the bonus given to you 2years later? just click the link above , to see this kind of "trick"go get the money .

Wednesday, June 27, 2007

google trends (www.google.com/trends)

google.com/trends is a link that you can check the keywords you input for searching ,is most used by which countries and which cities , then you may know wat the countries and the citizens , the most actually ideas and thoughts in their mind. Such as "Fuck" and "Shit",you may check which counties ,their people always searching for it. The ranks and the trends they showed out.Go ,then you may know it ,hehe .. i think it is easy for you just guess ,that which kind of character they may have.

Tuesday, June 26, 2007

samsung SSD harddisks


now SSD (solid state disk),nearly it compatable with the PCMCIA of notebook ,65G for $500. And samsung is the first manufature publish this kind of disk.Now it has 18G and 65G 18" ssd,suit for umpc and notebook,laptop. and for 3.5' sata ssd ,it is now up to 256,and more.But for 2.5' ,it is just published recently,here is QPI 's products:

now the price is too high, lets wait for 2 or 3 years, it will the same as notebook, it is another battle for the digits manuafatures,and now after 360G sata hard disk , the express card ssd will be the new for every digit funs.the stable and the speed and the storage are the factors that all the users care about , so when a product comes out it should be shows the function and quanlity.

now

Monday, June 25, 2007

excel report genarting (the function inside of excel)

  将数据导出到Excel的方法有多种,速度有快慢之分,我用过三种方法,速度都比较快,下面的一种利用Excel内置的功能,是三种之中最快的。其中最主要的是下面两句:
xlQuery := xlSheet.QueryTables.Add(ADOQExport.Recordset ,xlSheet.Range['A3']);
xlQuery.Refresh;
  不过我这里稍为复杂一点,要通过某种条件完成分类汇总。

function ExportToExcel: Boolean;
var
xlApp, xlBook, xlSheet, xlQuery: Variant;
SQLCmd: String;
i, iNextRow: Integer;

//设定单元格默认格式
procedure ExcelSetDefaultFormat;
begin
xlSheet.Cells.Font.Name := '宋体';
xlSheet.Cells.Font.Size := 12;
xlSheet.Cells.VerticalAlignment := 2;
//xlSheet.Cells.RowHeight := 17.25;
xlSheet.Range['C:D'].HorizontalAlignment := xlCenter;
end;

//输出标题
procedure ExcelSetHeader;
begin
xlSheet.Range['A1'].Value := '显示在报表第一行的标题';
xlSheet.Range['A1:F1'].HorizontalAlignment := 7;
xlSheet.Range['1:1'].Font.Size := 18;
xlSheet.Range['1:1'].Font.Bold := true;
xlSheet.Range['A2'].Value := '文件编号:WL/B 19';
xlSheet.Range['A2'].Font.Size := 11;
xlSheet.Range['F2'].Value := '记录编号:GZ-023';
xlSheet.Range['F2'].HorizontalAlignment := xlRight;
xlSheet.Range['F2'].Font.Size := 11;
xlSheet.Range['A3'].Value := 'XXXXX有限公司';
xlSheet.Range['F3'].Value := '日期:2005-X-X' ;
xlSheet.Range['F3'].HorizontalAlignment := xlRight;
//输出字段名
ADOQExport.SQL.Strings[4] := 'where 1=0';
if ADOQExport.Active then ADOQExport.Requery else ADOQExport.Open;
xlQuery := xlSheet.QueryTables.Add(ADOQExport.Recordset ,xlSheet.Range['A4']);
xlQuery.FieldNames := true;
xlQuery.RowNumbers := False;
xlQuery.FillAdjacentFormulas := False;
xlQuery.PreserveFormatting := True;
xlQuery.RefreshOnFileOpen := False;
xlQuery.BackgroundQuery := True;
xlQuery.RefreshStyle := xlOverwriteCells; //xlInsertDeleteCells;
xlQuery.SavePassword := True;
xlQuery.SaveData := True;
xlQuery.AdjustColumnWidth := True;
xlQuery.RefreshPeriod := 0;
xlQuery.PreserveColumnInfo := True;
xlQuery.Refresh;
iNextRow := 5;
end;

//设置页脚
procedure ExcelSetFooter;
begin
xlSheet.PageSetup.LeftFooter := '制表:' + DM.UserInfo.UserName;
xlSheet.PageSetup.CenterFooter := '审核:';
xlSheet.PageSetup.RightFooter := '第 &P 页,共 &N 页';
end;

//输出汇总数据
procedure ExcelSetSum;
begin
xlSheet.Range[Format('A%d', [iNextRow])].Value := '条数合计(条)';
xlSheet.Range[Format('A%d:B%0:d', [iNextRow])].HorizontalAlignment := 7;
xlSheet.Range[Format('C%d', [iNextRow])].Value := FloatToStr(DBGridEh1.Columns[6].Footer.SumValue);
xlSheet.Range[Format('C%d:F%0:d', [iNextRow])].HorizontalAlignment := 7;
xlSheet.Range[Format('A%d:F%0:d', [iNextRow])].Font.Bold := true;
Inc(iNextRow);
xlSheet.Range[Format('A%d', [iNextRow])].Value := '重量合计(kg)';
xlSheet.Range[Format('A%d:B%0:d', [iNextRow])].HorizontalAlignment := 7;
xlSheet.Range[Format('C%d', [iNextRow])].Value := FloatToStr(DBGridEh1.Columns[7].Footer.SumValue);
xlSheet.Range[Format('C%d:F%0:d', [iNextRow])].HorizontalAlignment := 7;
xlSheet.Range[Format('A%d:F%0:d', [iNextRow])].Font.Bold := true;
end;

//根据类别输出数据到Excel
procedure ExportData(DataType: Byte);
begin
SQLCmd := Format('where DataType=%d ', [DataType]);
ADOQExport.SQL.Strings[4] := SQLCmd;
if ADOQExport.Active then ADOQExport.Requery else ADOQExport.Open;
ProgressBar1.StepIt;

if not ADOQExport.IsEmpty then begin
//标题
xlSheet.Range[Format('A%d', [iNextRow])].Value := DM.GetDataTypeStr(DataType);//将DataType转换为相应的文字显示
xlSheet.Range[Format('A%d:F%0:d', [iNextRow])].HorizontalAlignment := 7;
xlSheet.Range[Format('A%d:F%0:d', [iNextRow])].Font.Bold := true;
Inc(iNextRow);

xlQuery := xlSheet.QueryTables.Add(ADOQExport.Recordset ,xlSheet.Range[Format('A%d', [iNextRow])]);
xlQuery.FieldNames := false;
xlQuery.Refresh;
Inc(iNextRow, ADOQExport.RecordCount);
xlSheet.Range[Format('A%d', [iNextRow])].Value := DM.GetDataTypeStr(DataType) + '合计(条)';
xlSheet.Range[Format('A%d:B%0:d', [iNextRow])].HorizontalAlignment := 7;
xlSheet.Range[Format('C%d', [iNextRow])].Value := Format('=SUM(C%d:C%d)', [iNextRow-ADOQExport.RecordCount, iNextRow-1]);
xlSheet.Range[Format('D%d', [iNextRow])].Value := Format('=SUM(D%d:D%d)', [iNextRow-ADOQExport.RecordCount, iNextRow-1]);
xlSheet.Range[Format('A%d:F%0:d', [iNextRow])].Font.Bold := true;
Inc(iNextRow);
end;
ProgressBar1.StepIt;
end;

begin
Result := true;
ShowProgress(0, cbbDataType.KeyItems.Count*2+2, 0); //调用前面例子中的函数显示进度面板
Screen.Cursor := crHourGlass;
try try
//建立OLE对象
xlApp := CreateOleObject('Excel.Application');
xlBook := xlApp.Workbooks.Add;
xlSheet := xlBook.Worksheets['sheet1'];
xlApp.Visible := false;
ProgressBar1.StepIt;
//设置格式
ExcelSetDefaultFormat;
//输出标题内容
ExcelSetHeader;
ProgressBar1.StepIt;

//查询结果,导到EXCEL
for i:=0 to cbbDataType.KeyItems.Count-1 do //cbbDataType: TDBComboBoxEh
ExportData(StrToInt(cbbDataType.KeyItems.Strings[i]));
//输出汇总内容
ExcelSetSum;
//设置边框
xlSheet.Range[Format('A4:F%d', [iNextRow])].Borders.LineStyle := xlContinuous;
xlSheet.Cells.EntireColumn.AutoFit;
//输出页脚
ExcelSetFooter;
except
if not VarIsNull(xlApp) then
begin
xlApp.Quit;
xlApp.Disconnect;
xlApp := Unassigned;
xlApp := NULL;
end;
result := false;
Exit;
end;
finally
pnlShadow.Visible := false;
pnlProgress.Visible := false;
Screen.Cursor := crDefault;
xlSheet := Unassigned;
xlBook := Unassigned;
if not VarIsNull(xlApp) then begin
xlApp.Visible := true;
xlApp := Unassigned;
end;
if ADOQExport.Active then ADOQExport.Close;
end;
end;

Saturday, June 23, 2007

Contract translation(English to chinese)

Yesterday,one of my friends ,asked me to translate a contract for him, just becoz he is familiar with Education only, and i m having a job much closer to business.You know it is worth 500,000 US dollars,so i don't know have to help him and i still have to work on my task of project, so i just promised him that if he can not find other guy to help him i can only help him to do the rest of the translation during weekend.And now i am doing it , mostly ,the i had some business english during my collage,but it just for 2months , and did not use it too often, recently.So i have to remind all i learned during the collage.So it bring me back to the collage time,hehehe , so many words familiar."business Invioce" "all risks" "shipping point" "destination point" "contract period" "business days" "calendar days" ................so many things like this, i think it will make me get much of the business aera, though i wrote to my boss, that i will learn business deeply, since it becoz to truth aready and so quickly becoming.hehehe , you have to say , you wish it comes. it is the last weekend here i m in manila,hehe the time and days are under counted before i leave Philippines.Hope everyfriends here got happy.

Thursday, June 21, 2007

How long is your life ---deathclock

Every body just have the life one time , we like to say that Life won't take twice.So you have to take care fo yourself and others , be kindly treat yourself the best enviroment and the mood, it is better for your health and your family.And if you already know how long you still can live ,then wat wil you do first, something
urgent, something necesary. And we remind that the female called Hellen Keller and her famous article <> , i just don't know how to translate it correctly. But it is the same meaning to you , that during your life you just have oneday you can see, then wat you will do ~? you should think of it , it won't take you too much time ,then you will find out wat is the truth healthy and time meaning to you.here , we got the deathclock, according to your information you submitted , it will measure your healthy and then get the supposed result for you, and then , you can see how long is your life will be , and how much time you still have, and the time keeping on deducting , and time gone 1 second by 1sencon. hows your feeling , don't tell others, just ask yourself, wat have you done and wat you achived and wat you have donated? then wat else~?~?you got it ! deathclock


cool black cars----cool













add your web url into search engine(google,yahoo,msn,msn live...

This summary is not available. Please click here to view the post.

Wednesday, June 20, 2007

laptop wireless online easily

It has been many times that i have the laptop with Wifi but always have to put it on my knees , it lots of harm and radiative ,so harmful to our healthy.And we still have to go with it.But there's so many cases that one kind provide us the function that we can put our laptop /notebook on it. it goes convinient.see...

Now it is $150 but i think , someone will just buy a cheaper one ,hehe , i m not ask you to buy it , just tell you that there's lots of cases when you are travelling you can choose one of them ,make your trip much convinient and much funny ,easily. I like travel and there's much cases must consider , the hotel ,the ship , the plane, the train, still the taxi, especial you are in the foreign countries it will make you much scear of that encountering the urgent event. it will make you trouble and unhappy.So becareful and take care of your own treasures. I m sure you will be the one who find out whether there's peace place you should payattentoion. In case some of the travellors have encountered the cases that their passports lost , so they have to turn to the ambossors that will provide them the temporary passport to endup their staying in the countries they visiting.It is an awful experience , isn't it~?~?

Tuesday, June 19, 2007

GFW----great fire wall/government fire wall

GFW, I wanna write something about GFW for a long time ,but did not in the mood to do it ,hehe ,now i wanna talk something about it , it called great fire wall, may make you remaid that the Great wall of china, right , you are definitly correct. It has the same function that can block the enemies outside of it , so it also help the internet user in china to be seperated with the harmful information and porn goods&infomation.But it blocks Blogspot, wiki,and flikr,may be my blog will be blocked ,just because of the GFW, but i still wanna talk about it ,it blocks our own freedom and our democracy.it also have another name----government fire wall.i think , though now i am afraid that i can not open it in china, and it is that i can not open my blog and update it.and i keep in searching the way to avoid of the situation.and now i think i got it.http://www.great-firewall.com/if you are chinese you can understand it.it is better.otherwise , you just download it and set the proxy it provided ,or just download the Tor
it is the decode way to break the block.and chinabloggersare blocked sometimes ,just becoz some of the members wrote something with the content of harmful.
we have the ways to break the GFW.1.just set the foreign countries proxy(for chinese)
2.download the plungin software for firefox
3.have the Tor to solve the problme
and i still wanna to see whether there's another way to solve the problems.

Saturday, June 16, 2007

Father'sday

After i came back from RP(robinsion's place) where we always got our vegetables there and other goods.It is surprised to find it is nearly the fathers' day.
It is my first time to talk to my father directly , just wat i don't think he did right to me or to the family. He accepted my advice, but i don't know whether he will change his own style, as i know he is a indepent man , and powerful in my eyes.I m so fear of him. And now we talk to each other fairly and frankly , i think it is better that good for me to get close to my father. and the chart lasted for nearly 1 hour, he got tired and don't want me to waste too much money on the talk. It is the first time, i talked so much with him. And during the years with him , i also went against him several times, it made him so sad for years. And last we did not talk to each other too much until i went to collage i started to talk to him oftenly , but not so long time. Unforgetful , so i just blog it.
type ur summary here

type the rest here

Friday, June 15, 2007

Occupation Planning

<> the book i bought in RP(robinson Place) ,200peso . When i in the jeepney i just read it ,and back to apartment i just make it as oral material , and read it before i went to bed, every night recently , i can not sleep early. It seems that all the guys after nearly 1 years of getting his first job , he got himself lost ,and after that he started to think about the plan the moment or before the moment he got his first job, all the guys have their own life plan and occupation plan for their life as well as job.
and it will go with the way according to the plan~? I don't think so, he is the environment,You won't know wat is the next will happen .But there's another way that as the Buddha said, everything has been set by the God.And your future is like a play that written by the God , you are just the actor who acted as the Play note. Though you encounter the trouble , it is also the scene that has been set there waiting for you .
It said just to the Normal people.And the abnormal ones are in the different situation,----special cases.Though the God can not arrange them.Who are they~?------ the much kindly ones and the much bad. It is a big variable. The will be the guys not in the play note . So are you going to be the ones that fully according to the routine that already set for you , or select the different way for yourself.It depends on your own behavior. So now , it is a much faster society, and the feed back also so fast, that if you don't have a strong heart , you can not afford of it.So i don't want to work just one career during my life, maybe it will be much easier for a guy that only have one career in his life.But it will be much bored that so tedious, i can not use to it. And i hope can try different roles in the society, first be the low level in it , now i going over it . second should be the much higher level. It means the manager level. But now it will be my first step, i know it is hard for me right now , coz i have to learn much more. And i will be always ready to get the new information from now on. Won't hope so, just do it!~!!!it will be much valuable that it will make much efforts .Second , i will set up my own company,it is a dream to me till now ,hehe ,everyone hope that can have his own business when he start to work. I m dreaming, as someone said:"don't stop dreaming, it will give you power!" But i have to remember that , it will be a good dream. Just step and step forward it. One of my office mate said that he will going to be a author after several years , but in people's mind is that , the authors almost can not be a rich guy. No. it is wrong viewpoint . I have to say that , it won't be proved in china.The most famous guy in china is Hanan(same pronunciation,but different Chinese characters), he got into high school successfully just by his own power of running 1000 meters only by 3'11'' that was when he is graduated from middle school with failed of examination. But he did it to get into the high school. See , it is another clues that life can be changed just coz the life variety.
and he got rich just by writing books, I think he is the first 16 years old only but already published his first book. <1 degree below zero> ..etc. wat i can not list completely. And he already can afford to the Benz Car he has , you can find out how rich he is . And he is not the most successful one being author. YI Zhongtian, who is writing the comment about the <> .He studied <> just for 10 years and he became successful and famous after he giving the comments on the management topic generated from three kingdoms on TV. and the series make hime became famous soon.(in chinese it said being famous just during one night) how fast it was.hehe , and he can get the money that just by writing books about history and generate the management points for the mordern society.¥2,000,000 at least for one year.Just have the version right, and famous name. hehe its value can be see . and another typical example is the author, named Wang shuo, he is now opened his own blog, and talking about his own life on it. and he disenclosed his private life about used to get chicks for playing before,it makes his name gose with the F words and S words across china.and it also make him being a charactical Pig, it means that too special and can not be accepted by the public and normal people. But his books are really good. But hanhan is against him,hahhaha .. famous against famous , it is typical in china.
Books, careers, occupation, money, famous .. it rushed into our life, and still keep being like this in a fast speed can not be imagined.How to go and where to go.... the famous star in HK said this after HK goes back to China. WE have to arrange the plan fit for ourself. Budda said that , just according to your own will and really feeling from your heart.

Tuesday, June 12, 2007

excel application control




 
全面控制 Excel

首先创建 Excel 对象,使用ComObj:

Dim ExcelID as Excel.Application

Set ExcelID as new Excel.Application

1) 显示当前窗口:

ExcelID.Visible := True;

2) 更改 Excel 标题栏:

ExcelID.Caption := '应用程序调用 Microsoft Excel';

3) 添加新工作簿:

ExcelID.WorkBooks.Add;

4) 打开已存在的工作簿:

ExcelID.WorkBooks.Open( 'C:\Excel\Demo.xls' );

5) 设置第2个工作表为活动工作表:

ExcelID.WorkSheets[2].Activate;

或 ExcelID.WorkSheets[ 'Sheet2' ].Activate;

6) 给单元格赋值:

ExcelID.Cells[1,4].Value := '第一行第四列';

7) 设置指定列的宽度(单位:字符个数),以第一列为例:

ExcelID.ActiveSheet.Columns[1].ColumnsWidth := 5;

8) 设置指定行的高度(单位:磅)(1磅=0.035厘米),以第二行为例:

ExcelID.ActiveSheet.Rows[2].RowHeight := 1/0.035; // 1厘米

9) 在第8行之前插入分页符:

ExcelID.WorkSheets[1].Rows[8].PageBreak := 1;

10) 在第8列之前删除分页符:

ExcelID.ActiveSheet.Columns[4].PageBreak := 0;

11) 指定边框线宽度:

ExcelID.ActiveSheet.Range[ 'B3:D4' ].Borders[2].Weight := 3;

1-左 2-右 3-顶 4-底 5-斜( \ ) 6-斜( / )

12) 清除第一行第四列单元格公式:

ExcelID.ActiveSheet.Cells[1,4].ClearContents;

13) 设置第一行字体属性:

ExcelID.ActiveSheet.Rows[1].Font.Name := '隶书';

ExcelID.ActiveSheet.Rows[1].Font.Color := clBlue;

ExcelID.ActiveSheet.Rows[1].Font.Bold := True;

ExcelID.ActiveSheet.Rows[1].Font.UnderLine := True;

14) 进行页面设置:

a.页眉:

ExcelID.ActiveSheet.PageSetup.CenterHeader := '报表演示';

b.页脚:

ExcelID.ActiveSheet.PageSetup.CenterFooter := '第&P页';

c.页眉到顶端边距2cm:

ExcelID.ActiveSheet.PageSetup.HeaderMargin := 2/0.035;

d.页脚到底端边距3cm:

ExcelID.ActiveSheet.PageSetup.HeaderMargin := 3/0.035;

e.顶边距2cm:

ExcelID.ActiveSheet.PageSetup.TopMargin := 2/0.035;

f.底边距2cm:

ExcelID.ActiveSheet.PageSetup.BottomMargin := 2/0.035;

g.左边距2cm:

ExcelID.ActiveSheet.PageSetup.LeftMargin := 2/0.035;

h.右边距2cm:

ExcelID.ActiveSheet.PageSetup.RightMargin := 2/0.035;

i.页面水平居中:

ExcelID.ActiveSheet.PageSetup.CenterHorizontally := 2/0.035;

j.页面垂直居中:

ExcelID.ActiveSheet.PageSetup.CenterVertically := 2/0.035;

k.打印单元格网线:

ExcelID.ActiveSheet.PageSetup.PrintGridLines := True;

15) 拷贝操作:

a.拷贝整个工作表:

ExcelID.ActiveSheet.Used.Range.Copy;

b.拷贝指定区域:

ExcelID.ActiveSheet.Range[ 'A1:E2' ].Copy;

c.从A1位置开始粘贴:

ExcelID.ActiveSheet.Range.[ 'A1' ].PasteSpecial;

d.从文件尾部开始粘贴:

ExcelID.ActiveSheet.Range.PasteSpecial;

16) 插入一行或一列:

a. ExcelID.ActiveSheet.Rows[2].Insert;

b. ExcelID.ActiveSheet.Columns[1].Insert;

17) 删除一行或一列:

a. ExcelID.ActiveSheet.Rows[2].Delete;

b. ExcelID.ActiveSheet.Columns[1].Delete;

18) 打印预览工作表:

ExcelID.ActiveSheet.PrintPreview;

19) 打印输出工作表:

ExcelID.ActiveSheet.PrintOut;

20) 工作表保存:

If not ExcelID.ActiveWorkBook.Saved then

ExcelID.ActiveSheet.PrintPreview

End if

21) 工作表另存为:

ExcelID.SaveAs( 'C:\Excel\Demo1.xls' );

22) 放弃存盘:

ExcelID.ActiveWorkBook.Saved := True;

23) 关闭工作簿:

ExcelID.WorkBooks.Close;

24) 退出 Excel:

ExcelID.Quit;

25) 设置工作表密码:

ExcelID.ActiveSheet.Protect "123", DrawingObjects:=True, Contents:=True, Scenarios:=True

26) EXCEL的显示方式为最大化

ExcelID.Application.WindowState = xlMaximized

27) 工作薄显示方式为最大化

ExcelID.ActiveWindow.WindowState = xlMaximized

28) 设置打开默认工作薄数量

ExcelID.SheetsInNewWorkbook = 3

29) '关闭时是否提示保存(true 保存;false 不保存)

ExcelID.DisplayAlerts = False

30) 设置拆分窗口,及固定行位置

ExcelID.ActiveWindow.SplitRow = 1

ExcelID.ActiveWindow.FreezePanes = True

31) 设置打印时固定打印内容

ExcelID.ActiveSheet.PageSetup.PrintTitleRows = "$1:$1"

32) 设置打印标题

ExcelID.ActiveSheet.PageSetup.PrintTitleColumns = ""

33) 设置显示方式(分页方式显示)

ExcelID.ActiveWindow.View = xlPageBreakPreview

34) 设置显示比例

ExcelID.ActiveWindow.Zoom = 100

35) 让Excel 响应 DDE 请求

Ex.Application.IgnoreRemoteRequests = False



用VB操作EXCEL

Private Sub Command3_Click()

On Error GoTo err1

Dim i As Long

Dim j As Long

Dim objExl As Excel.Application '声明对象变量

Me.MousePointer = 11 '改变鼠标样式

Set objExl = New Excel.Application '初始化对象变量

objExl.SheetsInNewWorkbook = 1 '将新建的工作薄数量设为1

objExl.Workbooks.Add '增加一个工作薄

objExl.Sheets(objExl.Sheets.Count).Name = "book1" '修改工作薄名称

objExl.Sheets.Add , objExl.Sheets("book1") ‘增加第二个工作薄在第一个之后

objExl.Sheets(objExl.Sheets.Count).Name = "book2"

objExl.Sheets.Add , objExl.Sheets("book2") ‘增加第三个工作薄在第二个之后

objExl.Sheets(objExl.Sheets.Count).Name = "book3"



objExl.Sheets("book1").Select '选中工作薄

For i = 1 To 50 '循环写入数据

For j = 1 To 5

If i = 1 Then

objExl.Selection.NumberFormatLocal = "@" '设置格式为文本

objExl.Cells(i, j) = " E " & i & j

Else

objExl.Cells(i, j) = i & j

End If

Next

Next



objExl.Rows("1:1").Select '选中第一行

objExl.Selection.Font.Bold = True '设为粗体

objExl.Selection.Font.Size = 24 '设置字体大小

objExl.Cells.EntireColumn.AutoFit '自动调整列宽

objExl.ActiveWindow.SplitRow = 1 '拆分第一行

objExl.ActiveWindow. SplitColumn = 0 '拆分列

objExl.ActiveWindow.FreezePanes = True '固定拆分 objExl.ActiveSheet.PageSetup.PrintTitleRows = "$1:$1" '设置打印固定行

objExl.ActiveSheet.PageSetup.PrintTitleColumns = "" '打印标题 objExl.ActiveSheet.PageSetup.RightFooter = "打印时间: " & _

Format(Now, "yyyy年mm月dd日 hh:MM:ss")

objExl.ActiveWindow.View = xlPageBreakPreview '设置显示方式

objExl.ActiveWindow.Zoom = 100 '设置显示大小

'给工作表加密码

objExl.ActiveSheet.Protect "123", DrawingObjects:=True, _

Contents:=True, Scenarios:=True

objExl.Application.IgnoreRemoteRequests = False

objExl.Visible = True '使EXCEL可见

objExl.Application.WindowState = xlMaximized 'EXCEL的显示方式为最大化

objExl.ActiveWindow.WindowState = xlMaximized '工作薄显示方式为最大化

objExl.SheetsInNewWorkbook = 3 '将默认新工作薄数量改回3个

Set objExl = Nothing '清除对象

Me.MousePointer = 0 '修改鼠标

Exit Sub

err1:

objExl.SheetsInNewWorkbook = 3

objExl.DisplayAlerts = False '关闭时不提示保存

objExl.Quit '关闭EXCEL

objExl.DisplayAlerts = True '关闭时提示保存

Set objExl = Nothing

Me.MousePointer = 0

End Sub

Sql 2000 procedure

 摘要:本文以SQL Server2000存储过程为例,探讨了存储过程的优点,并以Visual Basic6.0程序设计语言给出了调用存储过程的关键代码。

  关键字:数据库;SQL Server2000;存储过程;应用程序;VB
 
  存储过程

  存储过程是存储在服务器上的一组预编译的Transact-SQL语句,是一种封装重复任务操作的方法,支持用户提供的变量,具有强大的编程功能。它类似于DOS系统中的BAT文件。在BAT文件中,可以包含一组经常执行的命令,这组命令通过BAT文件的执行而被执行。同样的道理,可以把要完成某项任务的许多Transact-SQL语句写在一起,组织成存储过程的形式,通过执行该存储过程就可以完成这项任务。存储过程与BAT文件又有差别,即存储过程已经进行了预编译。

  1、创建存储过程的方法

  在Transact-SQL语言中,创建存储过程可以使用CREATE PROCEDURE语句,其语法形式如下:






CREATE PROC[EDURE] procedure_name[;number]
[{@parameter data_type}[VARYING][=default][OUTPUT]
]],…n]
[WITH{RECOMPILE|ENCRYPTION|RECOMPILE,ENCRYPTION}]
[FOR REPLICATION]
AS sql_statement[…n]

  在上面的CREATE PROCEDURE语句中,方括号"[ ]"中的内容是可选的,花括号"{}"中的内容是必须出现的,不能省略,[,…n]表示前面的参数样式,可以重复出现。竖线"|"表示两边的选项可以任选一个。

  下面分析该语句中各种选项的含义。

  CREATE PROCEDURE是关键字,也可以写成CREATE PROC。

  procedure_name是该存储过程的名称,名称可以是任何符合命名规则的标示符。名称后的[;number]参数表示可以定义一系列的存储过程名称,这些存储过程的数量由number指定。

  参数名称可以使用@parameter data_type来指定。在Transact-SQL语言中,用户定义的参数名称前面加"@"符号,这些数据类型是Transact-SQL语言允许的各种数据类型,包括系统提供的数据类型和用户定义的数据类型。

  当参数类型为cursor时,必须使用关键字VARYING和OUTPUT。VARYING表示结果集可以是一个输出参数,其内容是动态的。该关键字只能在使用游标作为数据类型时使用。关键字OUTPUT表示这是一个输出参数,可以把存储过程执行的结果信息返回应用程序。
default用于指定参数的默认值。

  RECOMPILE选项表示重新编译该存储过程。该选项只是在需要的时候才使用,例如经常需要改变数据库模式时。

  ENCRYPTION选项用来加密创建存储过程的文本,防止他人查看。

  选项FOR REPLICATION主要用于复制过程中。注意,该选项不能和选项RECOMPILE同时使用。

  AS是一个关键字,表示其后的内容是存储过程的语句。参数sql-statement[…n]表示在一个存储过程中可以包含多个Transact-SQL语句。

  2、存储过程的优点

  在频繁访问数据库的系统中,开发者都乐于使用存储过程,这与存储过程的下列优点是分不开的。

  ⑴ 存储过程可以与其他应用程序共享应用程序的逻辑,从而确保一致的数据访问和操纵。

  ⑵ 存储过程提供了一种安全机制。如果用户被授予执行存储过程权限,那么即使该用户没有访问在执行该存储过程中所参考的表或视图的权限,该用户也可以完全执行该存储过程而不受到影响。因此,可以创建存储过程来完成所有的增加、删除等操作,并且可以通过编程控制上述操作中对信息的访问权限。

  ⑶ 存储过程执行速度快,便于提高系统的性能。由于存储过程在第一次执行之后,其执行规划就驻存在过程高速缓冲存储区中,在以后的操作中,只需从过程高速缓冲存储区中调用编译好的二进制形式存储过程来执行。

  ⑷ 使用存储过程可以减少网络传输时间。如果有一千条Transact-SQL语句的命令,一条一条地通过网络在客户机和服务器之间传送,那么这种传输所耗费的时间将很长。但是,如果把这一千条Transact-SQL语句的命令写成一条较为复杂的存储过程命令,这时在客户机和服务器之间网络传输所需的时间就会大大减少。

  SQL Server 2000数据库存储过程的调用

  VB作为当今应用极为普遍的数据库客户端开发工具之一,对客户端应用程序调用服务器端存储过程提供了强大的支持。特别是随着VB6.0的推出,VB客户端应用程序可以方便地利用ADO的对象和集合来实现对数据库存储过程的调用。

  在笔者编写的科技档案管理系统中,就是采用VB作为开发平台,采用SQL Server2000数据库管理数据,在这个科技档案管理系统中有海量的数据,并且对数据库有频繁的访问,利用存储过程访问数据库节省了执行时间,大大提高了系统的性能。

  1、ADO简介

  ADO控件(也称为ADO Data控件)与VB固有的Data控件相似。使用ADO Data控件,可以利用Microsoft ActiveX Data Objects(ADO)快速建立数据库绑定控件和数据提供者之间的连接。

  ADO Data控件可以实现以下功能:

  ·连接一个本地数据库或远程数据库。

  ·打开一个指定的数据库表,或定义一个基于结构化查询语言(SQL)的查询、存储过程或该数据库中的表的视图的记录集合。

  ·将数据字段的数值传递给数据绑定控件,可以在这些控件中显示或更改这些数值。

  ·添加新的记录,或根据更改显示在绑定的控件中的数据来更新一个数据库。

  2、数据库的连接

  数据库的连接可通过ADO控件实现,为此,必须在工程部件中选择Microsoft ADO Data Control 6.0 (OLEDB),然后在窗体中添加ADO控件。利用ADO连接数据库有两种方法,具体如下。

  1) 通过ADODC属性页实现连接

  在ADODC属性页中选择生成按钮,进入数据链接属性对话框;然后选择该对话框中的连接属性页,选择或输入服务器名称和数据库等重要信息;最后测试连接,连接成功后,按确定按钮,返回到属性页对话框,可获得连接字符串,如下例:






Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Science_File;Data Source=Data_Server

  其中sa是用户名;Science_File是数据库名;Data_Server是数据库名。

  通过下列语句,即可连接到指定的数据库:





dim odbcstr as String, adocon As New ADODB.Connection
odbcstr = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Science_File;Data Source=Data_Server"
adocon.Open odbcstr '连接到数据库

  2) 直接使用连接语句实现

  连接数据库的语句如下:






Dim ado as ADODC
ado.ConnectionString = "Provider=SQLOLEDB.1;Password=" & User_Pwd & ";Persist Security Info=True;User ID=" & User_Name & ";Initial Catalog=" & Data_Name & ";Data Source=" & server_name

  其中User-Pwd是用户密码;User_Name是用户名;Data_Name是数据库名;server_name是服务器名。

  连接数据库成功后就可以调用存储过程执行操作。

  3、存储过程的调用

  假设有一个名为doc_ProcName存储过程,该存储过程有一个输入参数,一个输出参数。

  1) 直接传递参数调用存储过程

  直接传递参数方法主要通过以下几个步骤来实现:

  (1) 通过ADODB的Connection对象打开与数据源的连接;

  (2) 通过ActiveConnection指定Command对象当前所属的Connection对象;

  (3) 通过CommandText属性设置Command对象的源,即要调用的存储过程;

  (4) 通过CommandType属性确定Command对象的源类型,如果源类型为存储过程CommandType即为adCmdStoredProc;

  (5) 通过Command对象的Parameters集合向所调用的存储过程传递参数,其中对象Parameters(0)为执行存储过程的返回值,返回值为0则执行存储过程成功;

  (6) 通过Eexecute方法执行在 CommandText 属性中指定的存储过程。

  以存储过程doc_ProcName为例,关键代码如下:






Dim strS As String '定义一变量
Dim adoconn As New ADODB.Connection 'Connection 对象代表了打开与数据源的连接。
Dim adocomm As New ADODB.Command 'Command 对象定义了将对数据源执行的指定命令。
Dim ReturnValue As Integer '调用存储过程的返回值
adoconn.ConnectionString = Adodc1.ConnectionString 'Adodc1为窗体中的ADO控件,并已成功连接数据库
adoconn.Open
Set adocomm.ActiveConnection = adoconn '指示指定的 Command对象当前所属的 Connection对象。
adocomm.CommandText = "doc_ProcName" '设置Command对象源。
adocomm.CommandType = adCmdStoredProc '通知提供者CommandText属性有什么,它可能包括Command对象的源类型。设置这个属性优化了该命令的执行。
adocomm.Parameters(1) = "1"
adocomm.Parameters(2) = "OutputParameters" 'OutputParameters可以为任意的字符串或数字
adocomm.Execute
ReturnValue = adocomm.Parameters(0) '存储过程的返回值,返回0则成功执行。
strS = adocomm.Parameters(2) '把存储过程的输出参数的值赋给变量strS

  2) 追加参数法调用存储过程

  追加参数通过CreateParameter方法,用来指定属性创建新的Parameter对象。具体语法如下:






Set parameter = command.CreateParameter (Name, Type, Direction, Size, Value)

  ·Name 可选,字符串,代表 Parameter 对象名称。
  ·Type 可选,长整型值,指定 Parameter 对象数据类型。
  ·Direction 可选,长整型值,指定 Parameter 对象类型。
  ·Size 可选,长整型值,指定参数值最大长度(以字符或字节数为单位)。
  ·Value 可选,变体型,指定 Parameter 对象值。

  这种方法与上面一种方法的分别主要在于,追加参数的方法在向存储过程传递参数时,这种方法首先通过CreateParameter方法为存储过程创建参数,然后通过Append方法将创建的参数追加到Parameters集合中去。

  仍然以存储过程doc_ProcName的调用为例,关键代码如下:





Dim mRst As ADODB.Recordset 'Recordset 对象表示的是来自基本表或命令执行结果的记录全集。
Dim prm As ADODB.Parameter 'Parameter 对象代表参数或与基于参数化查询或存储过程的Command 对象相关联的参数。
adoconn.ConnectionString = Adodc1.ConnectionString
adoconn.Open
Set adocomm.ActiveConnection = adoconn
adocomm.CommandText = "doc_ProcName"
adocomm.CommandType = adCmdStoredProc
Set prm = adocomm.CreateParameter("parameter1", adTinyInt, adParamInput, , "1")
adocomm.Parameters.Append prm
Set prm = adocomm.CreateParameter("parameter2", adInteger, adParamOutput)
adocomm.Parameters.Append prm
Set mRst = adocomm.Execute
ReturnValue = adocomm.Parameters(0)

  以上代码中未定义的变量以及未注释的语句与前述相同。

  结束语

  在应用程序中调用服务器端存储过程,不仅能显著提高整个应用的性能,而且能加强对数据库数据的保护。VB为客户端应用程序调用存储过程提供了一组方便而有效的方法。


VB Excel Programming

With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Recap of Practice Charges To" & Chr(10) & "Research Charges" & Chr(10) & "By Payor" & Chr(10) & " " & strFromChrtDte & " Through " & strToChrtDte
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.19)
.BottomMargin = Application.InchesToPoints(0.05)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.01)
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 5
End With

ActiveSheet.ResetAllPageBreaks
With Worksheets("INDIV")
.HPageBreaks.Add .Range("A35")
.HPageBreaks.Add .Range("A65")
.HPageBreaks.Add .Range("A94")
.HPageBreaks.Add .Range("A124")
End With


reset the pagebreak
ActiveWindow.View = xlPageBreakPreview

If you want to reset to none is case all over the place as you state try:
Cells.PageBreak = xlNone

Also look if you are using code if you have any of these code line that are kicking in:
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
ActiveWindow.SelectedSheets.VPageBreaks.Add Before:=ActiveCell


merge excel cells

mxlSheet.Range(mxlSheet.Cells(1, p), mxlSheet.Cells(1, i)).MergeCells = True
mxlSheet.Range(mxlSheet.Cells(1, p), mxlSheet.Cells(1, i)).HorizontalAlignment = xlCenter
mxlSheet.Range(mxlSheet.Cells(1, p), mxlSheet.Cells(1, i)).font.bold = True
mxlSheet.Range(mxlSheet.Cells(1, p), mxlSheet.Cells(1, i)) = Name

p and i are integers that I set above.


sample clause 2
Here's the zoom function
ActiveWindow.Zoom = 77

And the Horizontal Alignment. Keep in mind you will need to have a selection made or use a range statement with the HorizontalAlignment function like I'm showing here.

Range("C9:H9").HorizontalAlignment = xlCenterAcrossSelection


set the page property of Excel




in VB Sql "" problem

the seesights of the Manila

Japanese Excel programming in VB

Monday, June 11, 2007

inurl:"ViewerFrame?Mode="

inurl:"ViewerFrame?Mode=" ,after seaching this you will find several web cameras ,and you may see the office and the buildings in the cameras,hehehe ,nice ,coz they already open these web cameras to the internet, and just you open the url directly from searching the google. Google can control the applications through Gmail remote control function,shutdown pc and other applications , though may be you will find that google is watching your actions on you pc which connected to the internet. when you using the google 's products.May be one day you will be living as naked , hehe ......here shows the sample of the web cameras by googling .A japan Office
a building
a kitchen
a shop

Thursday, June 7, 2007

Enjoy the life in Manila (caylabney)

For so long , i have been here for nearly One year! In one word , here We learned different things here and got lots of friends here . Though you ask me to leave without say goodbye , i can not do it. As the guys at the same age , i lost the focus on the life , the same as enid, but she did it well.Now it is my turn to show good in the life. Never lost confidence. I think nearly 1 month later , i will be in Shenzhen, and start another page of life , hope it will be a fruitful future. Hehe , enid have talking the changes or not in her blog, and my best friend also referred it on the day i met him, then from that moment , the life changed totally , it brought me into the trouble .i think it is the timing to change myself and life. So it is tough for me to watch much more clear about the society and the life around you ,though the people around you . Always i hope that i can go out with the friends i knew here , coz i know days later we will just can contact each other by email and Yahoo messager only . That's why we treasure the happy hours together . and totally , during these days in manila , the officemates and the friends are so nice .But it fadeaway our enthusiasm .I hope the new guys from china will enjoy the life here for a whole year. And also hope our friends here can alw ays enjoy the happy hours no matter in the office also in the family. We won't forget wat you brought us before. The experience will always in mind , the happy screens will be as the pictures in our brain.
Remember that Gnet said when i said "thx" to them , it seems like a thx speech , hehe , yep! may be , it like a speech, but it from my heart. It only 1month nearly. S o soonly we will miss each other.Though we may meet again ,but it will be a long time .Thanks again! to office mates to our friends.I m going to have a summary about the life living here in manila.hehe .....i think i will be the one to record the latest days in manila.heheh ...take a good view of the city again.Bring back the memory of it and share the experience with my friends.Though there's some bad guys in manila, though there's bad guys anywhere in the world. But the people here a very kindly and friendly mostly.
And wat i can not forget is that the good view of the beach and the holiday halidome . We just have been several place for holiday but the memory here in that place is very nice......hehe ..... it seems we like the traveller here in Philippines , but at least we learned English /Learned working experience here and started our life it is totally different for a fresh man to have this kinda of working experience.and i will shows out the pictures here in the Manila. The summary will be left to the next post. here we go............

the farmer working in the farm, hehe ....it brought me back to my childhood.....in the old days we have the same work.And i used to enjoy the feeling working in the farm,hehehehe , as a girl said"we can not bring back the old days"



the sky and the fields are connected together , it looks like a picture ,and it is the natural one in our eyes. Always stay in the city you can not imagine wat a nice view it shows .So don't bury yourself in the damn city ,go out and try to use the different sight to enjoy the nature.you will have the totally different feeling.
this is the first sight of the cablabney ,so near though so far away we still have to go across the hill way to down to the beach. But it is so excited that we are near our first trip destination.and going to enjoy our first office mates outing.!!!!!!!!HUHU..........

Try to see it in another angle ,see it is different at all. the mountain looks like a girl with the green skirt and always with energy , and powerful to welcome the customers coming. Waving her hands and shaking her long green hair......
The Sky is blue and the sea is blue , and the sun is light and our heart is bright too.step into the totel from the door, hey .. "huhuhuh!!!!"

The frist time to the beach hotel , the decoration of the hotel is so classical and make the traveller feel warm and quiety , so nice and so cool.

you will feel it is so nice , wat a kind of seesight that the god gave it as a gift. So we live in the world and the beautiful sight is besides us, don't miss the chance to enjoy it.... so i use the "Love the world"as the subject of this blog , just becoz i love this kind of view in philippines, that's why i wanna travel around the world and find the good views ..hehe ... hope i walk around the whole world.Don't just saying it , work on it ,,,,,make it to true...........


the light is a little dark , but it is also nice.
a ship and travel with it , around the sea of the world, wat a kind of feeling , during the life if i have the chance to get a ship i will enjoy it in the sea..Can not waiting to have that kind of life.
this is the picture i like mostly, heheh... coz i make me to see the feet of the mountain and the start of the sea... that says the start and the end always can be a circle in the world. one start it means another one is being generated never end never disappeared , it just show out in different type and status.
Hehehehe , the trees it make me remember that , during the middle school that i just watch that the discovery chanel and that , i feel that the trees also the plants have the same feeling of information as human, and days later it is improved in the discovery chanel , i was so excited. from then on i feel that life always show amazing to human.
green mountain , i like it , don't you ?!??!?!
a piere that , we can imagine that everyone have his own pier , when where how it is just the problem of timing . when time comes that you will load in your own pier, Kuya got into his pier , hope he will happy forever , sure , he will, hahhahah
Houses water ,trees , hehehehe, got relax and enjoy the air in the cablaybney ,hahahah ......i really lost myself in that kind of life , but the time is too short ,just 2days....no less than it , but we start our first job by that time....

Monday, June 4, 2007

Rocketdock


type ur summary here

Rocketdock
the rocketdock is a tool for fast load .. and easy add your icon . now it is much steadable for you and easy use than before.you can add your file and path to it .it with a good view and nice interface.

Friday, June 1, 2007

my way (frank sinatra)

And now, the end is near;
And so I face the final curtain.
My friend, I'll say it clear,


I'll state my case, of which I'm certain.
I've lived a life that's full.
I've traveled each and ev'ry highway;
And more, much more than this,
I did it my way.
Regrets, I've had a few;
But then again, too few to mention.
I did what I had to do
And saw it through without exemption.
I planned each charted course;
Each careful step along the byway,
But more, much more than this,
I did it my way.
Yes, there were times, I'm sure you knew
When I bit off more than I could chew.
But through it all, when there was doubt,
I ate it up and spit it out.
I faced it all and I stood tall;
And did it my way.
I've loved, I've laughed and cried.
I've had my fill; my share of losing.
And now, as tears subside,
I find it all so amusing.
To think I did all that;
And may I say - not in a shy way,
"Oh no, oh no not me,
I did it my way".
For what is a man, what has he got?
If not himself, then he has naught.
To say the things he truly feels;
And not the words of one who kneels.
The record shows I took the blows -
And did it my way!
Yes, it was my way