European Windows 2012 Hosting BLOG

BLOG about Windows 2012 Hosting and SQL 2012 Hosting - Dedicated to European Windows Hosting Customer

European Windows Hosting - Amsterdam :: How to Solve - The ‘Microsoft.Jet.OLEDB.4.0′ provider is not registered on the local machine.

clock July 4, 2012 08:47 by author Scott

Sometimes you will receive this error message on Windows Server 2008:

The ‘Microsoft.Jet.OLEDB.4.0′ provider is not registered on the local machine

As you know, this is just simple problem. IIS on Windows Server 2008 was running its application pool in 64 bit mode. There are no 64 bit Jet drivers. Simply changing the application pool to run in 32 bit mode enables support for the 32 bit Jet drivers.


To do this right click on the target application pool in IIS, select Advanced Settings and change Enable 32-Bit Applications to True.

If you want to check that you have the latest version of the Jet drivers goto c:\Windows\SysWOW64, right click on the Msjet40.dll file, select the details tab and view the version number. At the time of writing the latest version was 4.0.9704.0. You can view more details on this process at http://support.microsoft.com/kb/239114.

Hope it help!

 

 



European Windows Hosting - Amsterdam :: How to Redirecting HTTP requests to HTTPS

clock May 8, 2012 08:46 by author Scott

A common question that is often asked is how to auto-magically redirect HTTP requests for your web sites to HTTPS. Simply put, if someone types “http://www.yoursite.com” how can you redirect that request to “https://www.yoursite.com”?

For a complete look at how URL Rewriting works, take a look at the following MSDN article on
URL Rewrite. Then look at the following as an example of what to add to your web.config:

<rewrite>
  <rules>
    <rule name="Redirect to HTTPS" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="^OFF$" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
    </rule>
  </rules>
</rewrite>



European Amsterdam Windows Hosting :: How to Solve - The SMTP server requires a secure connection or the client was not authenticated

clock February 3, 2012 04:13 by author Scott

Today I will show you how to solve problem in send message when you host with hosting provider. This is the error message:

The SMTP server requires a secure connection or the client was not authenticated. The server response was: host5.vdconline.vn ESMTP MailEnable Service, Version: 5.51-- denied access at 02/03/12 02:45:26

Please try this solution below:

Public Shared Sub SendEmail(  


    Dim Message As New Net.Mail.MailMessage() 

    Dim FromEmail As New Net.Mail.MailAddress(“From Email Address”)
    Message.From = FromEmail
    Message.To.Add(“To Email Address”)  


    Message.Subject = “Subject of the Email”
    Message.Body = “Body of the Email”
    ‘Message.SubjectEncoding = System.Text.Encoding.UTF8
    ‘Message.BodyEncoding = System.Text.Encoding.UTF8
    ‘Message.IsBodyHtml = False
    ‘Message.Priority = Net.Mail.MailPriority.High 

    Dim SmtpClient As New Net.Mail.SmtpClient(“smtp.YourEmailServer.com”, PortNo eg: 587 for gmail )
    SmtpClient.EnableSsl = True
    ‘smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
    ‘smtp.UseDefaultCredentials = False 

SmtpClient.Credentials = New Net.NetworkCredential(“YourEmailAddress”, “YourEmailPassword”

    SmtpClient.Send(Message)  


End Sub

Note: An important point to note is that you have to set the EnableSSl to True before you set the NetWork Credentials of your SMTP client.



European IIS 7 Hosting :: How to Fix - Server Error in ‘/’ Application on IIS 7 (allowDefinition=’MachineToApplication’)

clock January 26, 2012 05:37 by author Scott

This is the error message that sometimes you can find on IIS:

Server Error in ‘/’ Application.


Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

I will gonna show you how to fix this issue. What is the issue?

1. When you create an new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application. However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and may get the above error. The debug information you get as mentioned above, is applicable to this scenario.

To resolve it, Right Click on the virtual directory - select properties and then click on "Create" next to the "Application" Label and the textbox. It will automatically create the "application" using the virtual directory's name. Now the application can be accessed.

2. When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the
authentication or sessionstate is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application (as mentioned in the above point).

Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we wish to protect the admin pages from unathorized users).

But actually, this can be achieved in the web.config at the application's root level itself, by specifing the location path tags and authorization, as follows:-

<location path="Admin">
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</location>


However, if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode as follows:-

<configuration>
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</configuration>


Thus you can protect the sub-directory from unauthorized access.



European Windows 2008 Hosting :: How to Use and Set External Mail Records in Plesk 9.5 Control Panel

clock January 17, 2012 05:17 by author Scott

If you wish to use the mailboxes for a specific domain name with an external mail server, you can easily do that by following these steps:

1. Go to Domains, click the Domain Name.
2. In the Web Site group click DNS Settings
3. Now in the record type column, locate MX record, and click the respective link in the Host column on the left.
4. Next, in the enter mail exchanger box, type the external mail server’s name and click OK.
5. Click Up Level to return to the Domain Management screen.
6. Now click Mail Accounts and Mail Settings.
7. Clear the Activate mail service on domain check box and click OK.

Your domain will now use an external mail server.



European Windows Hosting :: How to Block a Website on Your Computer

clock January 13, 2012 07:20 by author Scott

If you would like to block a website from being viewed on your Windows computer, follow these steps:

1. You need to run C:\WINDOWS\system32\drivers\etc

2. Then, backup the
hosts file.

3. Open hosts file there from the notepad.

4. At the end of the line you can see as per below.

127.0.0.1 localhost

5. Append the following line at the end

127.0.0.1 BlockSitename.com # replace the BlockSitename.com with the site name that you want to block.

6. Then go to Start->Run-> type ipconfig /flushdns



European Windows Hosting :: DNS Tools - How to Use Traceroute?

clock January 12, 2012 06:59 by author Scott

In this tutorial, I will show you how to use Traceroute on your Windows. Please go to Startà Runà Cmd. Then, you must type tracert, give a space then add your domain name. See this example below:



IP Whois – Also pronounced as Who is, this tool is more often used to know information about the IP address of a particular domain, its location and the details about the registrar and owner. It basically is a query and response protocol used extensively to lookup to databases holding information about registered users of an Internet resource.

Reverse DNS lookup – Also referred to as the rDNS, it is mandatory to have it on your server. It is used for determining the association of a domain name with a particular IP address using the Domain Name System (DNS) of the Internet.

SPAM DB Lookup – This tool enables server administrators to look for the possible accounts on server to be included in the spammers list. Spam DB lookup enables them to check if the server and its IP’s have been added to the list due to a possible spamming activity carried out by someone using the server.

DNS Lookup – DNS lookup is used to determine various DNS records such as A, MX records, CNAME etc. for a particular domain. Using this simple tool, one can check where a particular site is hosted.



European Windows Hosting :: How to Fix Failed to Retrieve Directory Listing in Filezilla

clock January 10, 2012 08:15 by author Scott

Yesterday, we have just talked about how to connect FTP with Web Browser. In this tutorial, I will show you the error message that sometimes shown when we connect with Filezilla. This in a common error message that you will find on Filezilla:

Failed to retrieve directory listing.

Here is the image:



As the image shows, the connection enters Passive (PASV) Mode and after that, the error occurs. A solution that could work, is to disable passive mode. Here’s how you do that in FileZilla:

- Open Filezilla, go to Edit -> Settings
- Click on Connection -> FTP: Choose Active
- Click on Connection -> FTP -> Active Mode: Select "Ask your operating system for the external IP address”
- Click on Connection -> FTP -> Passive Mode: Choose Fall Back to Active Mode
- Press OK.



Hope it helps. Good luck



European Windows 2008 Hosting :: Connect to FTP with Internet Explorer or Web Browser

clock January 9, 2012 16:40 by author Scott

There are many ways to connect by FTP to a host, we can use tools such as Filezilla, CoreFTP, or SmartFTP. But I would recommend to use Filezilla, very simpe, FREE, and easy to use. In this article, I will assume you cant connect or you don’t have a FTP client software. So, in this case you need to use Internet Explorer to connect it.

You can upload and delete files at your online server using Internet Explorer.

In order to connect by FTP with your browser, use the following address:

ftp://FtpUserID:[email protected]

For example, let’s assume the following:

FTP User: HostForLife
Password: googletest
Site: www.testFTP.com

The above information would use the following in the Internet Explorer Address bar:

ftp://HostForLife: [email protected]

However, if your FTP user used to connect is similar to [email protected], then you will have to URL encode it like this:

ftp:// FtpUserID%40YourDomainName.com:[email protected]

In the case above, it is important to note what the FTP username is:

FtpUserID%40YourDomainName.com

This address is URL-encoded and comes from [email protected] where @ has been substituted with %40, which is the ASCII code for @.

After visiting your website by using the above exampled address, Internet Explorer will open the site content in its window. Then from the “View” menu of Internet Explorer, you may select “Open FTP site in Windows Explorer” to edit, upload or delete the files at your web server.

Hope this tutorial will help you.



European Windows 2008 Hosting :: How to Solve Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

clock December 20, 2011 06:02 by author Scott

The Scenario:

Sometimes you may get a timeout issue looking something like this:

System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader()

The important part here is what is in the exception message:


System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

This may give you the impression that the server is down or something similar.

However, this is basically the SqlCommand.CommandTimeout property that has expired; the default timeout is 30 seconds.

See more at:

".NET Framework Class Library -> SqlCommand.CommandTimeout Property"

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx

Now, why would it time out?

There are 2 common reasons.

Long running tasks or uncommitted transactions. Let's show this by example.

In the first example, we emulate that the command execution takes a very long time to execute and return, for example there could be millions of rows being updated or for some other reason the execution takes a long time.

In the code I just call the SQL Server method "waitfor delay" that will pause the execution in SQL Server for 30 seconds, I then change the SqlCommand.CommandTimeout  from 30 seconds to 10 seconds so that we do not have to sit all day and wait for the exception. The code should be pretty self explanatory, just create a console application in Visual Studio.

Note that we connect to the trusty Northwind, if we would set the CommandTimeout to 60 seconds, then after 30 seconds we would get our Shippers table data back.

        static void Main(string[] args)
        {
            string cString = @"Data source=<your server>;Integrated Security=SSPI;Initial Catalog=Northwind";
            using (SqlConnection sc = new SqlConnection(cString))
            {
                try
                {
                    SqlCommand cmd = new SqlCommand("waitfor delay '00:00:30';select * from Shippers", sc);
                    cmd.CommandTimeout = 10;
                    Console.WriteLine("CommandTimeout: {0}", cmd.CommandTimeout);
                    sc.Open();
                    SqlDataReader r = cmd.ExecuteReader();
                    while (r.Read())
                        Console.WriteLine("{0} : {1}", r[0].ToString(), r[1].ToString());
                    sc.Close();
                }
                catch (SqlException se)
                {
                    Console.WriteLine(se);
                }
            }
        }

Run it, and after 10 seconds you will get the exception:

System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   ...

For the second reason, that there might be an uncommitted transaction, again we will use Northwind running the following the code, almost the same as above (only difference is that there is no call to “waitfor delay” in the SQL):

        static void Main(string[] args)
        {
            string cString = @"Data source=<your server>;Integrated Security=SSPI;Initial Catalog=Northwind";
            using (SqlConnection sc = new SqlConnection(cString))
            {
                try
                {
                    SqlCommand cmd = new SqlCommand("select * from Shippers", sc);
                    cmd.CommandTimeout = 10;
                    Console.WriteLine("CommandTimeout: {0}", cmd.CommandTimeout);
                    sc.Open();
                    SqlDataReader r = cmd.ExecuteReader();
                    while (r.Read())
                        Console.WriteLine("{0} : {1}", r[0].ToString(), r[1].ToString());
                    sc.Close();
                }
                catch (SqlException se)
                {
                    Console.WriteLine(se);
                }
            }
        }

Run this code and you should get the rows in the Shippers table returned.

Now, open Query Analyzer or Sql Server Management Studio and execute an uncommitted transaction on the Shippers table, like so:

use Northwind
go

begin tran
 update Shippers set CompanyName = 'aaaaa' where ShipperID = 1
--commit

(Note that the new value, in this case 'aaaaa' must be different compared to the existing one in order to see the problem)

Rerun the code above, and after 10 seconds you will, again, get the exception:

System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   ...

Go back to Query Analyzer or Sql Server Management Studio and commit the transaction, rerun code, and you will once again get the Shippers table data returned.

So to summarize, if the command you are executing is a long running one, adjust the CommandTimeout accordingly. If there are uncommitted transactions, you need to find what and where they are and change your code or your stored procedures accordingly.This is outside the scope of this blog, but one way to check for uncommitted transactions is to from QA or SSMS run the following:

dbcc opentran ('Northwind')

This will show if there are any blocked spids in the Northwind database which could be an indication of uncommitted transactions and queries that are blocked as a result of this.

It may seem obvious that a command times out if the command timeout expires. The background for this post is that I had a case where occasionally my customers’ users could not log in to their system. There was no clear pattern to this, and what happened when they tried to log in was that they got the exception above.  In the end it turned out that they had a page in the application that allowed the user to change employee information.

The problem was that when they made the change, they opened a transaction, however, they did not commit it until the user pressed a Save button. The interval between starting the edit of the employee information and the saving of it could be anything, either they made the change and saved immediately, or they made the change and went to lunch without saving.

During this time, all the logins would fail since the login functionality basically did a select from the employee table with the users’ login and password, which subsequently failed since the table was locked by the uncommitted transaction.

Once this was figured out, and the changes were made, all was well in login land.



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in