Santosh 的个人资料Santosh Kumar照片日志列表更多 ![]() | 帮助 |
Compact And Repair an MDB fileWhen insert and deletion happens to mdb files, insertion increases the file size but deletion doesn’t reduce it. It requires repairing. If you do action called ‘compact and repair’ from within Microsoft Access, it may take hours. The following visual basic code can do the same quickly. This code requires a reference of ‘Microsoft Jet and Replication Objects 2.6 Library’ Private Sub DoCompactAndRepair() On Error GoTo ErrHnd lblActionMsg.Visible = True Dim vMyAccDB, vMyTmpDB, vMyAccPath, vMyTmpPath vMyAccDB = App.Path & "\" & "MyAccDB.mdb" vMyTmpDB = App.Path & "\" & "MyTmpDB.mdb" Refresh If Dir(vMyTmpDB) <> "" Then Kill vMyTmpDB Dim vMSJetAndReplicationObj As JRO.JetEngine Set vMSJetAndReplicationObj = New JRO.JetEngine vMyAccPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" vMyAccPath = vMyAccPath & vMyAccDB & ";Jet OLEDB:Database Password=MyPwd" vMyTmpPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" vMyTmpPath = vMyTmpPath & vMyTmpDB & ";Jet OLEDB:Database Password=MyPwd" vMSJetAndReplicationObj.CompactDatabase vMyAccPath, vMyTmpPath Kill vMyAccDB Name vMyTmpDB As vMyAccDB lblActionMsg = "Done" GoTo EndSmt ErrHnd: lblActionMsg = Err.Number & " " & Err.Description EndSmt: Screen.MousePointer = vbDefault End Sub Short Story ... Luck favors those who help themselvesA flood was threatening a small town and everyone was leaving for safety except one man who said, "God will save me. I have faith." As the water level rose a jeep came to rescue him, the man refused, saying "God will save me. I have faith." As the water level rose further, he went up to the second storey, and a boat came to help him. Again he refused to go, Belying, "God will save me. I have faith." The water kept rising and the man climbed on to the roof. A helicopter came to rescue him, but he said, "God will save me. I have faith." Well, finally he drowned. When he reached his Maker he angrily questioned, "I had complete faith in you. Why did you ignore my prayers and let me drown?" The Lord replied, "Who do you think sent you the jeep, the boat, and the helicopter?" The only way to overcome the fatalistic attitude is to accept responsibility and believe in the law of cause and effect rather than luck. It takes action, preparation and planning rather than waiting, wondering or wishing, to accomplish anything in life. by Shiv Khera { You Can Win } ASP.Net, Handling refresh and navigation keysMany a time we see some banking and alike websites used to request, not to press refresh button, not to click back/forward button, not to press alt + left/right arrow keys. The reason is simple enough, there exits security issues. The .Net way is quite simpler to handle the things to a great extent Using a session variable and a hidden label the issues on refresh can be handled. And use of IsPostBack can handle the navigation related issues. The following code illustrates it. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Session("RefreshCtr") Is Nothing Then Session("RefreshCtr") = 1 lblRefresh.Text = Session("RefreshCtr") End If If Not IsPostBack Then 'Code for execution on page load End If End Sub Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If lblRefresh.Text = Session("RefreshCtr") Then Session("RefreshCtr") = Session("RefreshCtr") + 1 Try 'Code for execution on submit Catch ex As Exception 'Code for error handling Finally 'Code that must be executed End Try End If End Sub Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender lblRefresh.Text = Session("RefreshCtr") End Sub »»»»»»» by Santosh Kumar ? Original @ http://santu4you.spaces.live.com Safer main dhoop to hogiसफ़र मे धूप तो होगी जो चल सको तो चलो सभी हैं भीड मे तुम भी निकल सको तो चलो
किसी के वास्ते राहें कहां बदलती है
तुम अपने आप को बदल सको तो चलो
यहां किसी को कोइ रास्ता नही देता
मुझे गिरा के अगर तुम सम्भल सको तो चलो
यही है जिन्दगी कुछ खाब चन्द उम्मिदें
इन्ही खिलौनो से तुम भी बहल सको तो चलो
हर एक सफ़र को है मेफ़ूज़ रास्तों की तलास
हिफ़ज़त की रिवात बदल सको तो चलो
कहीं नही कोइ सुरज धुवां धुवां है फ़िज़ा
खुद अपने आप से बाहर निकल सको तो चलो
बने बनाये हैं सांचे जो ढल सको तो चलो
इधर उधर कई मन्ज़िलें हैं जो चल सको तो चलो by Nida Fazli Short Story ... How they catch monkeys in indiaMonkey-hunters use a box with an opening at the top, big enough for the monkey to slide its hand in. Inside the box are nuts. The monkey grabs the nuts and now its hand becomes a fist. The monkey tries to get its hand out but the opening is big enough for the hand to slide in, but too small for the fist to come out. Now the monkey has a choice, either to let go off the nuts and be free forever or hang on to the nuts and get caught. Guess what it picks every time? You guessed it. He hangs on to the nuts and gets caught. We are no different from monkeys. We all hang on to some nuts that keep us from going forward in life. by Shiv Khera { You Can Win } Short Story ... Pride of performancePride of performance does not represent ego. It represents pleasure with humility. The quality of the work and the quality of the worker are inseparable. Half-hearted effort does not produce half results; it produces no results. Three people were laying bricks and a passerby asked them what they were doing. The first one replied, "Don't you see I am making a living?" The second one said, "Don't you see I am laying bricks?" The third one said, "I am building a beautiful monument." Three people doing the same thing gave totally different replies. The question is : did they have different attitudes? And would their attitude affect their performance? The answer is a clear yes. by Shiv Khera { You Can Win } Short Story ... Life is full of Choices and CompromisesThere is a contradiction here. If life is full of choices, where is the question of compromises? Remember, even a compromise is a choice. Let's evaluate this. How is Life Full of Choices? When we eat too much, we make a choice to be overweight. When we drink too much, we make a choice to have a headache the next day. If you drink and drive, you make a choice to risk being killed or killing someone in an accident. When we ill treat people, we make a choice to be ill treated in return. When we don't care about other people, we make a choice not to be cared for by other people. Choices have consequences. We are free to make our choice but after we have chosen, the choice controls us. We have equal opportunity to be unequal. The choice is ours. Life 38 of 38 can be compared to a pottery maker who shapes clay in any form he wants. Similarly, we can mold our lives into any shape we want. How is Life Full of Compromises? Life is not just party and pleasure; it is also pain and despair. Unthinkable things happen. Sometimes everything turns upside down. Bad things happen to good people. Some things are beyond control, such as physical disability and birth defects. We cannot choose our parents or the circumstances of our birth. So if the ball bounced that way, sorry. But what do we do from here; cry or take the ball and run? That is a choice we have to make. by Shiv Khera { You Can Win } Excel, Shortcuts for working with formulaOpening paste function window: At any point of time SHIFT+F3 can be pressed to get the paste function window. And a desired function can be selected to work with. Opening formula window: Press CTRL+A, after typing ‘=’ symbol and then the function name, to get the parameter window. For example, press CTRL+A after typing ‘=pmt’ Getting syntax inline: Press CTRL+SHIFT+A, after typing ‘=’ symbol and then the function name, to get the syntax. For example, press CTRL+SHIFT+A after typing =pmt, you will get ‘=pmt(rate,nper,pv,fv,type)’ typed automatically on the cell. »»»»»»» by Santosh Kumar ? Original @ http://santu4you.spaces.live.com Excel, Finding exact date differencesThe following example demonstrates how to find the date difference in terms of years, months and days between two dates. Let us think that you already have first three columns and you want the fourth one. Simply put the formula ‘=DATEDIF(B2,C2,"y") & "y " & DATEDIF(B2,C2,"ym") & "m " & DATEDIF(B2,C2,"md") & "d"’ at cell D2 and copy the same up to D44 EMP_NAME HIRE_DATE DATE_BY EXP_ASON Paolo 27-Aug-1992 9-Sep-2008 16y 0m 13d Pedro 24-Dec-1990 9-Sep-2008 17y 8m 16d Victoria 13-Sep-1990 9-Sep-2008 17y 11m 27d Helen 21-Sep-1989 9-Sep-2008 18y 11m 19d Lesley 13-Feb-1991 9-Sep-2008 17y 6m 27d Roland 5-Sep-1991 9-Sep-2008 17y 0m 4d Rita 9-Oct-1993 9-Sep-2008 14y 11m 0d Helvetius 19-Mar-1993 9-Sep-2008 15y 5m 21d Timothy 19-Jun-1988 9-Sep-2008 20y 2m 21d Sven 5-Apr-1991 9-Sep-2008 17y 5m 4d Miguel 7-Dec-1992 9-Sep-2008 15y 9m 2d Paula 19-Jan-1994 9-Sep-2008 14y 7m 21d Manuel 9-Jan-1989 9-Sep-2008 19y 8m 0d Howard 19-Nov-1988 9-Sep-2008 19y 9m 21d Martin 13-Apr-1990 9-Sep-2008 18y 4m 27d Gary 9-Aug-1988 9-Sep-2008 20y 1m 0d Daniel 1-Jan-1990 9-Sep-2008 18y 8m 8d »»»»»»» by Santosh Kumar ? Original @ http://santu4you.spaces.live.com Kadam Milaakar Chalna Hogaबाधायें आती हैं आयें, घिरें प्रलय की घोर घटायें, पावों के नीचे अंगारे, सिर पर बरसें यदि ज्वालायें, निज हाथों में हंसते-हंसते, आग लगाकर जलना होगा। कदम मिलाकर चलना होगा। हास्य-रूदन में, तूफानों में, अगर असंख्यक बलिदानों में, उद्यानों में, वीरानों में, अपमानों में, सम्मानों में, उन्नत मस्तक, उभरा सीना, पीड़ाओं में पलना होगा। कदम मिलाकर चलना होगा। उजियारे में, अंधकार में, कल कहार में, बीच धार में, घोर घृणा में, पूत प्यार में, क्षणिक जीत में, दीघर हार में, जीवन के शत-शत आकर्षक, अरमानों को ढ़लना होगा। कदम मिलाकर चलना होगा। सम्मुख फैला अगर ध्येय पथ, प्रगति चिरंतन कैसा इति अब, सुस्मित हर्षित कैसा श्रम श्लथ, असफल, सफल समान मनोरथ, सब कुछ देकर कुछ न मांगते, पावस बनकर ढ़लना होगा। कदम मिलाकर चलना होगा। कुछ कांटों से सज्जित जीवन, प्रखर प्यार से वंचित यौवन, नीरवता से मुखरित मधुबन, परहित अर्पित अपना तन-मन, जीवन को शत-शत आहुति में, जलना होगा, गलना होगा। कदम मिलाकर चलना होगा। by Atal Bihari Vajpayee Excel, Automating a Trial Balance Short Story ... Yes I'm courageous because"So you think I'm courageous?" she asked. "Yes, I do." "Perhaps I am. But that's because I've had some inspiring teachers. I'll tell you about one of them. Many years ago, when I worked as a volunteer at Stanford Hospital, I got to know a little girl named Liza who was suffering from a rare and serious disease. Her only chance of recovery appeared to be a blood transfusion from her five-year-old brother, who had miraculously survived the same disease and had developed the antibodies needed to combat the illness. The doctor explained the situation to her little brother, and asked the boy if he would be willing to give his blood to his sister. I saw him hesitate for only a moment before taking a deep breath and saying, 'Yes, I'll do it if it will save Liza.' "As the transfusion progressed, he lay in a bed next to his sister and smiled, as we all did, seeing the color returning to her cheeks. Then his face grew pale and his smile faded. He looked up at the doctor and asked with a trembling voice, 'Will I start to die right away?' "Being young, the boy had misunderstood the doctor; he thought he was going to have to give her all his blood. "Yes, I've learned courage," she added, "because I've had inspiring teachers." by Dan Millman { Chicken Soup for the Soul } Short Story ... What makes you Go UpThere was a man who made a living selling balloons at a fair. He had all colors of balloons, including red, yellow, blue, and green. Whenever business was slow, he would release a helium-filled balloon into the air and when the children saw it go up, they all wanted to buy one. They would come up to him, buy a balloon, and his sales would go up again. He continued this process all day. One day, he felt someone tugging at his jacket. He turned around and saw a little boy who asked, "If you release a black balloon, would that also fly?" Moved by the boy's concern, the man replied with empathy, "Son, it is not the color of the balloon, it is what is inside that makes it go up." by Shiv Khera { You Can Win } Declaration of this Blog SpaceThis URL http://santu4you.spaces.live.com previously http://spaces.msn.com/santu4you contains blogs posted by me i.e. Santosh Kumar. The basic idea is Knowledge & Thought Sharing. The flag ‘»»»»»»» by Santosh Kumar ? Original @ http://santu4you.spaces.live.com’ indicates the blog is an original concept, posted and written by me. And for all other blogs, effort has been made to put the references for contents and materials found at web. No blog in terms of ‘Short Stories’, ‘Thoughts & Philosophy’ or any other one, from any book in hardcopy, is converted to softcopy for its electronic form; its all found at web. References may be found missing for old postings. If, at any point of time, the original writer objects for the referenced material in term of wrong reference, content changes if any, or otherwise if it is found illegal, then correction will be made for the blog or may be removed. Excel, Searching tipsMicrosoft Office, other office suits may also be, is bounded with a bunch of exciting features; that can make almost of official work happen within itself. Imagine a requirement where you are supposed to find those records, which contains a particular word anywhere in any field. These requirement may exit where address like of field are concerned e.g. M.G. word can be a road, street, area, district or anything else. Think of the following table, oracle gives it by default as SCOTT.EMP; I have modified a bit. S# EMP# NAME JOB HIREDATE SAL DEPTNO 1 7730 CLARK MANAGER 09-Jun-81 2450 10 2 7369 SMITH CLERK 17-Dec-80 800 20 3 7499 ALLEN SALESMAN 20-Feb-81 1600 30 4 7521 WARD SALESMAN 22-Feb-81 1250 30 5 7566 JONES MANAGER 02-Apr-81 2975 20 6 7654 MARTIN SALESMAN 28-Sep-81 1250 30 7 7698 BLAKE MANAGER 01-May-81 2850 30 8 7788 SCOTT ANALYST 19-Apr-87 3000 20 9 7839 KING PRESIDENT 17-Nov-81 5000 10 10 7844 TURNER SALESMAN 08-Sep-81 1500 30 11 7876 ADAMS CLERK 23-May-87 1100 20 12 7900 JAMES CLERK 03-Dec-81 950 30 13 7902 FORD ANALYST 03-Dec-81 3000 20 14 7934 MILLER CLERK 23-Jan-82 1300 10 Now, I want to search those records that contain 30 in it, anywhere. And they are rec#1(emp#), rec#3(deptno), rec#4(deptno), rec#6(deptno), rec#7(deptno), rec#8(sal), rec#10(deptno), rec#12(deptno), rec#13(sal), rec#14(sal). Now add a field FOUND to the right of DEPTNO and in cell H2, put a formula i.e. =IF(ISERROR(SEARCH("30",C3&D3&E3&F3&G3&H3)),"N","Y"). Using autofill feature copy the formula to rest of the cells in range H3 to H15. It now look like this. S# EMP# NAME JOB HIREDATE SAL DEPTNO FOUND 1 7730 CLARK MANAGER 09-Jun-81 2450 10 Y 2 7369 SMITH CLERK 17-Dec-80 800 20 N 3 7499 ALLEN SALESMAN 20-Feb-81 1600 30 Y 4 7521 WARD SALESMAN 22-Feb-81 1250 30 Y 5 7566 JONES MANAGER 02-Apr-81 2975 20 N 6 7654 MARTIN SALESMAN 28-Sep-81 1250 30 Y 7 7698 BLAKE MANAGER 01-May-81 2850 30 Y 8 7788 SCOTT ANALYST 19-Apr-87 3000 20 Y 9 7839 KING PRESIDENT 17-Nov-81 5000 10 N 10 7844 TURNER SALESMAN 08-Sep-81 1500 30 Y 11 7876 ADAMS CLERK 23-May-87 1100 20 N 12 7900 JAMES CLERK 03-Dec-81 950 30 Y 13 7902 FORD ANALYST 03-Dec-81 3000 20 Y 14 7934 MILLER CLERK 23-Jan-82 1300 10 Y Now it is up to you. If want to use autofilter, go ahead! By using the autofilter option you can filter for FOUND? field where it is Y. That’s all. »»»»»»» by Santosh Kumar ? Original @ http://santu4you.spaces.live.com Clear unwanted Items from Add Remove Program listRun the Registry Editor (REGEDIT). Open the key \ HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall And remove any unwanted subkeys under "Uninstall", that's all What does it mean
Javascript, Page break tipsUsing a specific tag, to print all the contents just below it, can one of the best idea to control page breaks. Here is the code that will do it by using H1 tag. var allh1tags = document.all.tags("H1"); for(ctr = 0; ctr < allh1tags.length; ctr++) { allh1tags(ctr).style.PageBreakBefore = "always"; } »»»»»»» by Santosh Kumar ? Original @ http://santu4you.spaces.live.com |
|
|