Tuesday, 28 February 2012

Enable errors display on the production server

They following lines in the web.config are the key to finding errors on the production servers.

<!-- Web.Config Configuration File --><configuration>    <system.web>        <customErrors mode="Off"/>    </system.web></configuration>


Caution:
Don't forget to return the mode into "RemoteOnly" immediately after finishing, that can be a real threat to your application if left behind.

Using SSMS with MS Access

The following is the steps to run a SQL statement against MS Access database using SSMS (SQL Server Management Studio)

1) Enable "Ad Hoc Distributed Queries


EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE


2)Use" OpenDataSource"


Select   * 
FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0', 'Data Source=\\ServerName\FolderName\DBFileName.mdb')...[TableName] AS T


Unfortunately, finally I got:  :'(


OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Cannot open database ''.  It may not be a database that your application recognizes, or the file may be corrupt.".
Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".


http://connect.microsoft.com/SQLServer/feedback/details/284113/import-excel-data-with-openrowset-on-production-server


Looks like the file should not be open by someone else!!!

Sunday, 5 February 2012

Detecting Access version which created the file

Although it might be so trivial as the title implies; however, it took me really hours deceived that this can be achieved through a straight forward method like looking up the file properties dialog or finding it somewhere on opening this file in the access application.

The outcome for this research was the following windows VB Script for opening an Access file and displaying the original Access version utilized based on a property called FileFormat.


AccessFieVersionDetector.vbs
--------------------------------

' Initialization
ScriptName = "** Access File Version Detector **"
MsgBox "Please select the Access file...", 0, ScriptName

' Input Access file path
Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
ObjFSO.InitialDir = "c:\"
InitFSO = ObjFSO.ShowOpen
If InitFSO = False Then
    MsgBox "Script Error: Please select a file!", 0, ScriptName
    Wscript.Quit
Else
    MsgBox "You selected the file: " & ObjFSO.FileName, 0, ScriptName
End If

' Open Access file specified
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase(ObjFSO.FileName)
CurrentFileFormat = objAccess.CurrentProject.FileFormat

' Display the equivalent Access version utilized to create this file
Select Case CurrentFileFormat
    Case 2
MsgBox "It is Microsoft Access 2", 0, ScriptName
    Case 7
MsgBox "It is Microsoft Access 95", 0, ScriptName
    Case 8
MsgBox "It is Microsoft Access 97" , 0, ScriptName
    Case 9
MsgBox "It is Microsoft Access 2000", 0, ScriptName
    Case 10
MsgBox "It is Microsoft Access 2003", 0, ScriptName
    Case 11
MsgBox "It is Microsoft Access 2007", 0, ScriptName
    Case 12
MsgBox "It is Microsoft Access 2010", 0, ScriptName
    Case 13
MsgBox "Not yet! ;)" + Chr(13) & Chr(10) + "It is Unknown file type!", 0, ScriptName
Case Else
MsgBox "It is unknown file type!"
End Select

Monday, 30 January 2012

SSRS ReportViewer loads endlessly

I would like to share this article, since it really took me more than an hour trying to troubleshoot this issue, going into the backend stored procedure and the data source and setting static parameters till I finally searched online and got into this very comprehensive post which saved my day.

I had just to include the parameters passing between an "IsPostBack" check!!!

MSDN Blogs > Brian Hartman's Report Viewer Blog > Reports Never Stop Loading With VS 2010

Thursday, 26 January 2012

SSRS Local parameters

I have just completed the SSRS course and I got a so nice tip to let the SSRS manage my parameters rather than doing it on the web page and linking them to my data source. It is apparent now that I am using rdlc in the local processing mode.

After serveral trials, it truned out that: "In local processing mode, the ReportViewer control does not provide a parameter input area that you can use to pass values used during data processing. ", http://msdn.microsoft.com/en-us/library/ms345248.aspx

Unfortunately!

Tuesday, 17 January 2012

New day has come!

A very good tip by experience:

Don't try over and over again on a problem when you are tired, just switch over to another task for an adequate time to have your full concentration then return to the initial issue fresh. When you get back and notice how fast the solution blinked in your mind after an organized thinking, you would value how much time you would have wasted if you didn't cut off your trials short for a fresh revissit.

This situation usually happens to me late after a long working day, but a fresh start in the morning usually comes with the solution mich faster!!!

Have a nice day!

Thursday, 12 January 2012

First Post!

This is actually more like a trial test than anything else. Although my profession involves managing websites, applications and portals to be accessible through the Internet to everyone, it is my first time to decide to have a real blog for myself. Nevertheless, I made several trials before but they were only for the sake trying things out from a technical perspective.