Sep 11, 2008

Oracle Oci.dll Error

I am working on a new computer on these days. So i had to install programs that i need again. Whenever i install Oracle client i get oci.dll error. I have been working with Oracle since 2005. 3 years and a few installation of Oracle client. Always the same error: "OracleClient error: Could not create an environment: OCIEnvCreate returned -1".

Since the aim of this blog is helping people and giving useful information i want to mention about this general error. I read some forums about this error. I found two useful solutions.
First solution:
On the Oracle 9.2 Client software you need to give the Authenticated User privilege to the Oracle Home by following these steps:

1. Log on to Windows as a user with Administrator privileges.
2. Launch Windows Explorer from the Start Menu and and navigate to the
ORACLE_HOME directory.
3. Right-click on the ORACLE_HOME folder and choose the "Properties" option
from the drop down list. A "Properties" window should appear.
4. Click on the "Security" tab on the "Properties" window.
5. Click on "Authenticated Users" item in the "Name" list (on Windows XP the
"Name" list is called "Group or user names").
6. Uncheck the "Read and Execute" box in the "Permissions" list (on Windows
XP the "Permissions" list is called "Permissions for Authenticated Users").
This box will be under the "Allow" column.
7. Check the "Read and Execute" box. This is the box you just unchecked.
8. Click the "Apply" button.
9. Click the "OK" button.
10. Reboot your computer after these changes have been made.

Re-execute the application and it should now work.
Second solution:
1. Go to C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG or an equivalent.
2. Open machine.config file
3. Find the line below:
<processmodel clientconnectedcheck="0:00:05" comauthenticationlevel="Connect" comimpersonationlevel="Impersonate" cpumask="0xffffffff" enable="true" idletimeout="Infinite" loglevel="Errors" maxiothreads="25" maxworkerthreads="25" memorylimit="60" password="AutoGenerate" requestlimit="Infinite" requestqueuelimit="5000" responsedeadlockinterval="00:03:00" responserestartdeadlockinterval="00:09:00" restartqueuelimit="10" shutdowntimeout="0:00:05" timeout="Infinite" username="machine" webgarden="false">
4. Change userName="machine" to userName="SYSTEM"
5. Then iisreset

Aug 10, 2008

How to move MS Sourcesafe to another server

Last week we decided to take ownership of Visual sourcesafe database to our work location. It was in another office. We were accessing to it by vpn. When we call get latest command on solution we were waiting so much because of project size.

What should we do? Someone said after installing VSS we can create a new VSS database. But what about the old historical data?

I tried to create a checklist:
1. Is new server ready?
2. How to access new server? It must be accessible by local and remote users.
3. Install VSS.
4. Create users on server (for folder sharing).
5. Let's test:
Create a new project on sourcesafe.
Give share and security permissions to new VSS database folder.
Open folder to remote access.
Test it with local and remote users.

If test is successful now we can take real project.
Before this make sure all users checked in items.

6. Close old VSS database. You may remove VSS database folder sharing.
7. Copy VSS folder to your new server.
8. In VSS add new project by selecting copied folder in new server.

What did we do?
By taking VSS folder we took all of defined users, passwords and history of sourcesafe. So you won't create users again and won't loose your old versions of items.

9. Now give permissions and tell users to change their paths to new server.

10. Users should unbind project and then add new VSS database to their list. Then bind and login with old user name and passwords.
It is done.

Jul 25, 2008

Time Management Software - Offline Version

How often do you take notes? Do you use notebook, agenda or papers? I take notes almost everyday.

I have an agenda and i use it when i attend meetings. Sometimes i do not want to use keyboard and like to draw something on it.

  • I use calendar extension for Thunderbird mail client. I recommend this tool if you use Thunderbird. It allows you to add tasks, reminders, notes, events and see them on calendar. These features are similar to Outlook's functions. Also you can synchronize calendar with your Google calendar.
  • I sometimes use Google. I prefer it because it is an online calendar and easy to use. Another reason is i am addicted of Google tools and i can integrate calendars with the other Google applications.
  • Google notes is my another favorite application. I use it for taking web notes. With a Firefox add on i can take web notes easily.
I have tried many other tools to take notes. Now i use tools that i listed above. Yesterday i was looking photos on flicker. I saw an interesting note taking picture and i really liked it. Now i want a notebook with squared line paper and a good pencil. I may use this technique soon.

Time-management software...
Originally uploaded by dgray_xplane

Jul 16, 2008

The Runaround Dilemma

Do you think sometimes people want more than you can give? I do. Unfortunately my workplace is not far away from users. They come and say their work is more important than the others. Imagine that ten people come like that. Which work is really important? Of course we have some procedures for ordering works. But users do not want to understand. They just want their works to be done. In this case managers should be clear and decisive.

We should aware of which works are really important. All important works are not urgent. We must separate works into two dimensions. Importance and urgency. Then we can find which works to do and which works not to do. Avoid not important and not urgent works. Do urgent and important works first. Plan important and not urgent works. And lastly delegate not important but urgent works.


  • Because we don’t know what is really important to us, everything seems important.
  • Because everything seems important, we have to do everything.
  • Other people, unfortunately, see us as doing everything, so they expect us to do everything.
  • Doing everything keeps us so busy, we don’t have time to think about what is really important to us.

          (Source: Franklin Covey Company - Focus document)

  • important adj 1: of much import, carrying with it serious consequences; weighty, momentous, grave, and significant
  • urgent adj 1: pressing, compelling; calling for or demanding immediate action; anything characterized by urgency

          (Source: Oxford English Dictionary)

 The idea of importance & urgency matrix comes from Franklin Covey Company. I saw the four quadrant shape then i decided to share with you.

Jul 15, 2008

Sending Mail with CDOSYS

In Send .Net Runtime Error messages with Email article i used sample code for sending mail in .net 1.1 version. Then I realize that it does not work in upper versions. I found a new way to send mail. It works in .net 2.0 and upper versions. This function has standard definitions in it. You can improve this function by convert some variables to function parameters. For example message body, from user and to user. It will be more flexible.

System.Web.Mail.MailMessage class is obsolete in .net 2.0 and upper versions. You must use System.Net.Mail.MailMessage class.

    1     Public Shared Function SendMail() As Boolean
    3         Dim iMsg As Object
    4         Dim iConf As Object
    5         Dim Flds As Object
    6         Dim strHTML As String
    7         Dim strSmartHost As String
    8         Dim blnStatus As Boolean = True
   10         Const cdoSendUsingPort As Integer = 25
   11         strSmartHost = "mail_host" 'modify
   13         iMsg = CreateObject("CDO.Message")
   14         iConf = CreateObject("CDO.Configuration")
   16         Flds = iConf.Fields
   18         ' set the CDOSYS configuration fields to use port 25 on the SMTP server
   20         With Flds
   21             .Item("") = cdoSendUsingPort
   22             .Item("") = 25
   23             .Item("") = strSmartHost
   24             .Item("") = 10
   25             .Item("") = "user" 'modify
   26             .Item("") = "pass" 'modify
   27             '.Update()
   28         End With
   30         ' build HTML for message body. 'modify
   31         strHTML = ""
   32         strHTML = strHTML & ""
   33         strHTML = strHTML & ""
   34         strHTML = strHTML & " This is the test HTML message body
" & DateTime.Now
   35         strHTML = strHTML & ""
   36         strHTML = strHTML & ""
   38         ' apply the settings to the message
   39         Try
   40             With iMsg
   41                 .Configuration = iConf
   42                 .To = "to_user_mail_address" 'modify
   43                 .From = "from_user_mail_address" 'modify
   44                 .Subject = "This is a test CDOSYS message (Sent via Port 25)"
   45                 .HTMLBody = strHTML
   46                 .Send()
   47             End With
   48         Catch ex As Exception
   49             blnStatus = False
   50         End Try
   52         ' cleanup of variables
   53         iMsg = Nothing
   54         iConf = Nothing
   55         Flds = Nothing
   57         Return blnStatus
   59     End Function

Jul 3, 2008

Copy As HTML

When i copied code from Visual Studio and pasted it to my blog, i wasted too much time for formatting. Now i have a tool for copying source code from VS in html format. So i get html code of source exactly what i see in VS. The name of program is Copy as HTML.

After installing the program you can use it in VS. Just select code and right click. You will see Copy as HTML menu item.

When you select it an option window comes. I use options that you see below.

And here result:

1 ' Review the values of the assembly attributes

3 <Assembly: AssemblyTitle("")>
4 <Assembly: AssemblyDescription("")>
5 <Assembly: AssemblyCompany("")>
6 <Assembly: AssemblyProduct("")>
7 <Assembly: AssemblyCopyright("")>
8 <Assembly: AssemblyTrademark("")>
9 <Assembly: CLSCompliant(True)>

You see it is useful and very easy to use.

Jun 30, 2008

Send .Net Runtime Error messages with Email

I have returned from vacation today. I have many works to do. I see my coworkers are not happy. Emails tell me everything. Error messages, user requests, bad test results, meetings, works, works...

In one week there are 201 .net runtime error emails. There are some problems with some developments.

We configured .net settings to emails runtime errors to us with detailed information. It is useful sometimes. But be careful, if you face many runtime errors your mailbox may be full. I recommend you to redirect error emails to your secondary email address if you have mail quota problems. If you want to use with your primary address you should filter messages and move them to new folder. So tracking error messages would be more easy.

I want to mention about how can we send error messages as we use. Our code works with .Net 1.1 version and not tested with upper versions. I think it should work with new versions.

Go to global.asax.vb and find Application_Error function. You may see "Fires when an error occurs" comment in it. In this function open try/catch block and paste code below in it.

Dim ex As Exception = Server.GetLastError().GetBaseException()
Dim ErrorMessage As String = ""
ErrorMessage = "<b>Error date :</b>" & DateTime.Now
ErrorMessage &= "<br><b>Error message : </b>" & ex.Message
ErrorMessage &= "<br><b>Error page and location :</b>" & ex.StackTrace
ErrorMessage &= "<br><b>User : </b>" & Session("ID_USER") 'If you have user info

'Submitted Form Information
ErrorMessage &= "<br><p><b><u>Form Info</u></b>"
Dim x As Integer = 0
Do While x < Request.Form.Count
ErrorMessage &= "<LI>" & Request.Form.Keys(x) & " : " & Request.Form(x) & ""
x += 1

'Server Variables
ErrorMessage &= "<p><b><u>Server Variables</u></b>"
x = 0

Do While x < Request.ServerVariables.Count
ErrorMessage &= "<LI>" & Request.ServerVariables.Keys(x) & " : " & Request.ServerVariables(x) & ""
x += 1

Dim objMsg As New System.Web.Mail.MailMessage
objMsg.BodyFormat = Mail.MailFormat.Html
objMsg.From = ConfigurationSettings.AppSettings("From")
objMsg.Subject = "Test Error! "
objMsg.To = "" 'Your email address
objMsg.Body = ErrorMessage
System.Web.Mail.SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("Smtp")

  • We keep "From" and "Smtp" variables in webconfig file. You can change it as you wish.
  • We do not email errors on production environment. Just using for test purposes.

Jun 28, 2008

Power of UI

When i was writing my "Exploring Ajax" article i mentioned a little bit to user interface. But then i delete one paragraph to make article more consistent. I do not want to throw that paragraph to trash.
Here is cut statements:
We need to ajax. We need to prevent post backs. We need to simplify user interfaces. Users should use project willingly by ease of use. I know some user interface developments are more valuable than complex business processes. Users do not see back end of the program. They know what they see. I remember we did a complex algorithm for a program. It was very hard indeed. We worked many weeks. Unfortunately users were not satisfied.

One day i changed icons on the screen. The project was transferred to us from another development group and they had used some ugly icons on the toolbar and menus. When users saw new clear icons they thank to us and started to use program and gave their feedback. Indeed program was working. But they did not want to work on it before. So they did not make tests and they behave like program had problems. It was a good experience for me.

No need to argue on power of the UI :)
 Categories :

Jun 27, 2008

Exploring ajax

I am on vacation now. I have not coded anything since last friday. But i can not stay away from coding. From last friday to today every night exploring for ajax frameworks and components. I want to recommend ajaxian and ajaxrain websites. I found good articles and examples about ajax frameworks on these sites. Of course there are many ajax sites but i recommend you to add these to your feed reader.

Anyway, i tested many ajax components but i am confused now. I could not make a decision to use which. and moo tools are my favourites. Yahoo, adobe and google also have their frameworks. If you are interested with ajax you know there are hundreds of ajax components. So which is the best?

First i need to make a decision for what purpose i will use this components. Now i have not a new project to start. The project that i work is written with vb.Net 2003. Project owners did not prefer to use any javascript framework when they started the project. Now there are over 200 hundred pages in the project. Also the development of the project continues without a break and all developments are critical as users say. As you see it is not easy to change all logic and pass all pages to javascript framework.

First action plan may be changing .net version from 1.1 to 2.0. So we can use update panel to provide ajax support and prevent postbacks. The simplest solutions seems to be version upgrade.

If i start a new project i should use javascript framework and proper ajax components. What is your opinion? I should make my own ajax library. Then make a plan which features of ajax i will use. This topic is endless :) I dont want to add anything but i should write a new article about ajax.

"This is the first post. Sorry if i have any mistakes (knowledge or english). You can comment my posts and warn me if you see any mistake."
 Categories :