Few useful articles for Upgrade from BizTalk 2006 to 2010:-
Software development tips, tricks and advice from NG Yew Ban, a professional Microsoft Certified Trainer and Microsoft Certified Solution Developer. BizTalk, ASP.NET, VB.NET, C#, Visual Basic, MS Access, MS SQL Server, Oracle, JavaScript, MS Office and more!
Tuesday, September 06, 2011
Saturday, July 09, 2011
C# Batch Replace with encoding
Here is the code I wrote for batch replace with GB2312 encoding:-
var dir = new DirectoryInfo(@"D:\hgb");
string strFileName;
string content;
var encoding = Encoding.GetEncoding(936);
foreach (var f in dir.GetFiles("*.htm", SearchOption.AllDirectories))
{
strFileName = f.DirectoryName + @"\" + f.Name;
using (StreamReader reader = new StreamReader(strFileName, encoding))
{
content = reader.ReadToEnd();
content = Regex.Replace(content, "font size=-1", "font size=48");
}
StreamWriter writer = new StreamWriter(strFileName, false, encoding);
writer.Write(content);
writer.Close();
}
var dir = new DirectoryInfo(@"D:\hgb");
string strFileName;
string content;
var encoding = Encoding.GetEncoding(936);
foreach (var f in dir.GetFiles("*.htm", SearchOption.AllDirectories))
{
strFileName = f.DirectoryName + @"\" + f.Name;
using (StreamReader reader = new StreamReader(strFileName, encoding))
{
content = reader.ReadToEnd();
content = Regex.Replace(content, "font size=-1", "font size=48");
}
StreamWriter writer = new StreamWriter(strFileName, false, encoding);
writer.Write(content);
writer.Close();
}
Thursday, July 07, 2011
10175 Lab Correction (SharePoint 2010 Application Development)
General
Lab 2
Lab 4
Lab 8
Lab 10
- Trainer MOC page number may different with student page number.
Lab 2
- There are spacing issues in Exercise 3 Task 4 PowerShell Commands, All *SP Solution commands should be corrected as *SPSolution, e.g. Add-SP Solution should be corrected as Add-SPSolution.
- The -GAC Deployment should be corrected as -GACDeployment
Lab 4
- We should remove the where clause in unfilteredJobs LINQ query from Exercise 3 Task 5 Step 12 then only step 21 All Jobs will be displayed correctly.
- The web.config never changed although the lab works as expected, this issue is caused by access denied, we have to fix it in Powershell:
$svc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$svc.RemoteAdministratorAccessDenied = $False
$svc.Update() - We should reference to System.Configuration to use the ConfigurationManager in Exercise 3 Task 2 Step 2.
- When you are instructed to input any object or variable name with spacing, please remove the space, example:- HR Training Management has to be input as HRTrainingManagement.
Lab 8
- There is a list "Mashup" is hidden, we can display it from SharePoint Designer All Files section.
Lab 10
- Please create a site page named Training for Exercise 2 Task 9 Step 3
- You may need to click the Share Documents few times to let the video thumbnails to display accordingly.
- The Microsoft Office is not activated in Hyper-V image and not able to perform Exercise 2 Task 1, workaround is to copy the Metro theme from C:\Program Files (x86)\Microsoft Office\Document Themes 14\Metro.thmx to Desktop
Monday, February 28, 2011
Unsubscribe Tweeter from Maxis
Recently test with Tweeter to try out Mobile notification, after testing try to unsubscribe but failed few times by sms STOP to 28933 Maxis Tweet2Me service.
Finally I can unsubscribed successfully by using this command:-
STOPTWEET2ME to 28933.
Receive the response from Maxis:-
RM0. Your Twitter SMS subscription has been terminated.
Finally I can unsubscribed successfully by using this command:-
STOP
Receive the response from Maxis:-
RM0. Your Twitter SMS subscription has been terminated.
Wednesday, January 12, 2011
Javascript getElementByTagName XML with namespace prefix
How to use Javascript to retrieve XML data with namespace prefix?
Example:-
We can use getElementByTagName together with namespace prefix to access the element value:-
xmlDoc.getElementsByTagName("ns0:POID")[0].firstChild.nodeValue ;
Whole code to access the XML data with namespace prefix via getElementsByTagName:-
<?xml version='1.0' ?>
<ns0:PO xmlns:ns0='http://www.abc.com/PO'>
<ns0:POID>PO123</ns0:POID>
<ns0:CustomerID>ABC007</ns0:CustomerID>
</ns0:PO>
Example:-
We can use getElementByTagName together with namespace prefix to access the element value:-
xmlDoc.getElementsByTagName("ns0:POID")[0].firstChild.nodeValue ;
Whole code to access the XML data with namespace prefix via getElementsByTagName:-
<html><head>
<script language="javascript">
function getXML()
{
var xmlstring = "<?xml version='1.0' ?><ns0:PO xmlns:ns0='http://www.abc.com/PO'><ns0:POID>PO123</ns0:POID><ns0:CustomerID>ABC007</ns0:CustomerID></ns0:PO>";
if (window.DOMParser)
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(xmlstring,"text/xml");
}
else // Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(xmlstring);
}
var x = xmlDoc.getElementsByTagName("ns0:POID")[0].firstChild.nodeValue ;
alert(x);
}
</script>
</head><body onload="javascript:getXML()">
</body></html><?xml version='1.0' ?>
<ns0:PO xmlns:ns0='http://www.abc.com/PO'>
<ns0:POID>PO123</ns0:POID>
<ns0:CustomerID>ABC007</ns0:CustomerID>
</ns0:PO>
Friday, August 13, 2010
BizTalk 2009 Redistributable CAB files
BizTalk 2009
What's new webcast - https://www106.livemeeting.com/cc/microsoftevents/view?id=BTS18AL&role=attend&pw=FGE399
Q&A
Windows XP
What's new webcast - https://www106.livemeeting.com/cc/microsoftevents/view?id=BTS18AL&role=attend&pw=FGE399
Q&A
Windows XP
- 32-bit: http://go.microsoft.com/fwlink/?LinkId=137256
- 64-bit: http://go.microsoft.com/fwlink/?LinkId=137262
- 32-bit: http://go.microsoft.com/fwlink/?LinkID=137166
- 64-bit: http://go.microsoft.com/fwlink/?LinkId=137260
- 32-bit: http://go.microsoft.com/fwlink/?LinkId=137259
- 64-bit: http://go.microsoft.com/fwlink/?LinkId=137263
Wednesday, November 18, 2009
T-SQL Split
I still have seen developer asking me how to Split in SQL Server, although we can enable CLR Integration in SQL Server, here is the classic one from SQL Server Magazine that I have used since SQL Server 2000 and it is very powerful, Treat Yourself to Fn_Split() - This UDF lets you emulate VB's Split() function and parameter arrays
CREATE FUNCTION fn_Split(@sText varchar(8000), @sDelim varchar(20) = ' ') RETURNS @retArray TABLE (idx smallint Primary Key, value varchar(8000)) AS BEGIN DECLARE @idx smallint, @value varchar(8000), @bcontinue bit, @iStrike smallint, @iDelimlength tinyint IF @sDelim = 'Space' BEGIN SET @sDelim = ' ' END SET @idx = 0 SET @sText = LTrim(RTrim(@sText)) SET @iDelimlength = DATALENGTH(@sDelim) SET @bcontinue = 1 IF NOT ((@iDelimlength = 0) or (@sDelim = 'Empty')) BEGIN WHILE @bcontinue = 1 BEGIN --If you can find the delimiter in the text, retrieve the first element and --insert it with its index into the return table. IF CHARINDEX(@sDelim, @sText)>0 BEGIN SET @value = SUBSTRING(@sText,1, CHARINDEX(@sDelim,@sText)-1) BEGIN INSERT @retArray (idx, value) VALUES (@idx, @value) END --Trim the element and its delimiter from the front of the string. --Increment the index and loop. SET @iStrike = DATALENGTH(@value) + @iDelimlength SET @idx = @idx + 1 SET @sText = LTrim(Right(@sText,DATALENGTH(@sText) - @iStrike)) END ELSE BEGIN --If you can抰 find the delimiter in the text, @sText is the last value in --@retArray. SET @value = @sText BEGIN INSERT @retArray (idx, value) VALUES (@idx, @value) END --Exit the WHILE loop. SET @bcontinue = 0 END END END ELSE BEGIN WHILE @bcontinue=1 BEGIN --If the delimiter is an empty string, check for remaining text --instead of a delimiter. Insert the first character into the --retArray table. Trim the character from the front of the string. --Increment the index and loop. IF DATALENGTH(@sText)>1 BEGIN SET @value = SUBSTRING(@sText,1,1) BEGIN INSERT @retArray (idx, value) VALUES (@idx, @value) END SET @idx = @idx+1 SET @sText = SUBSTRING(@sText,2,DATALENGTH(@sText)-1) END ELSE BEGIN --One character remains. --Insert the character, and exit the WHILE loop. INSERT @retArray (idx, value) VALUES (@idx, @sText) SET @bcontinue = 0 END END END RETURN END GO -- Sample Code for Using Fn_Split() in Pubs to Emulate a Parameter Array Use Pubs CREATE PROCEDURE procPubsTitleView @sAuthors varchar(8000) AS SELECT title, au_lname, price FROM Pubs.dbo.titleview JOIN dbo.fn_Split(@sAuthors, ',') ON au_lname = value RETURN GO
Saturday, October 31, 2009
Is BizTalk dead?
One of the frequently asked question - Is BizTalk Dead?
The question arises with the announcement of Dublin able to makes long running workflow implemented in Windows Workflow Foundation (WF) persisted in SQL Store, sounds like Biztalk.
More details at A First Look at WF 4.0, “Dublin”, and “Oslo” http://msdn.microsoft.com/en-us/library/dd200919.aspx
I have implemented BizTalk projects in multinational organizations with industry standard like SWIFT, my personal opinion is, no doubt WF, Dublin and Oslo are evolving technologies in application development, but BizTalk still playing as a strong leader in Integration technologies for EAI and B2B, reason being are
BizTalk Server and "Oslo" and .NET
"Oslo" is the codename for Microsoft’s forthcoming modeling platform. Modeling is used across a wide range of domains and allows more people to participate in application design and allows developers to write applications at a much higher level of abstraction. "Oslo" delivers a new integrated platform for connecting across modeling domains, including a new "Oslo" modeling tool, an "Oslo" modeling language, and an "Oslo" repository. As we gathered feedback from BizTalk customers, they indicated they would prefer to take a disciplined, evolutionary path to adopting some of these newer platform technologies. We have thousands of customers that have deployed mission-critical applications on top of our BizTalk Server architecture; they want to decide for themselves when to move to newer versions of the platform.
Therefore, it’s an important guiding principle to our planning efforts that we preserve our customers existing investments in their BizTalk Server infrastructure. In fact, you won’t need to upgrade BizTalk Server to take advantage of "Oslo" – current BizTalk Server 2006 R2 or BizTalk Server 2009 customers can benefit from "Oslo" by being able to leverage and compose existing services into new composite applications. BizTalk Server today provides the ability to service enable LOB systems or trading partners as web services (using WCF supported protocols), which can be composed with the "Oslo" modeling technologies.
This principle applies to advances in the .NET Framework as well, such as Windows Workflow Foundation (WF). In response to customer feedback, we are committed to continued support for BizTalk Server’s XLANG orchestration technology - the existing BizTalk orchestration engine. Additional support for WF will be prioritized for the coming releases based upon customer demand and scenarios.
The question arises with the announcement of Dublin able to makes long running workflow implemented in Windows Workflow Foundation (WF) persisted in SQL Store, sounds like Biztalk.
More details at A First Look at WF 4.0, “Dublin”, and “Oslo” http://msdn.microsoft.com/en-us/library/dd200919.aspx
I have implemented BizTalk projects in multinational organizations with industry standard like SWIFT, my personal opinion is, no doubt WF, Dublin and Oslo are evolving technologies in application development, but BizTalk still playing as a strong leader in Integration technologies for EAI and B2B, reason being are
- B2B industry standard like EDI, SWIFT, RosettaNet contains hundred to thousand schemas and only available in BizTalk as Accelerators. I do not think developers can create all these schema parser easily within short time frame
- BizTalk has many built in Network, Data and Application Adapters like MQ, MSMQ, SAP, Oracle, FTP, and etc and all these can be easily tested by BizTalk engineer, without BizTalk, this will need to develop by developers, I believe this is not a difficult task but also not a straight forward task for developer, and how to unit test all these protocol adpaters required sophisticated knowledge, is our developer have all these knowledge to work with different kind of network, data and application protocols?
- BizTalk Business Activity Monitoring (BAM) is a good integration analytical tool can be easily implemented by Business Analysts, Administrators and Developers, without BizTalk, can developers built this tool?
- Last but not least, from the business point of view, BizTalk has been sold to many multinational organizations and implemented successfully, will Microsoft stone themselves by killing BizTalk?
BizTalk Server and "Oslo" and .NET
"Oslo" is the codename for Microsoft’s forthcoming modeling platform. Modeling is used across a wide range of domains and allows more people to participate in application design and allows developers to write applications at a much higher level of abstraction. "Oslo" delivers a new integrated platform for connecting across modeling domains, including a new "Oslo" modeling tool, an "Oslo" modeling language, and an "Oslo" repository. As we gathered feedback from BizTalk customers, they indicated they would prefer to take a disciplined, evolutionary path to adopting some of these newer platform technologies. We have thousands of customers that have deployed mission-critical applications on top of our BizTalk Server architecture; they want to decide for themselves when to move to newer versions of the platform.
Therefore, it’s an important guiding principle to our planning efforts that we preserve our customers existing investments in their BizTalk Server infrastructure. In fact, you won’t need to upgrade BizTalk Server to take advantage of "Oslo" – current BizTalk Server 2006 R2 or BizTalk Server 2009 customers can benefit from "Oslo" by being able to leverage and compose existing services into new composite applications. BizTalk Server today provides the ability to service enable LOB systems or trading partners as web services (using WCF supported protocols), which can be composed with the "Oslo" modeling technologies.
This principle applies to advances in the .NET Framework as well, such as Windows Workflow Foundation (WF). In response to customer feedback, we are committed to continued support for BizTalk Server’s XLANG orchestration technology - the existing BizTalk orchestration engine. Additional support for WF will be prioritized for the coming releases based upon customer demand and scenarios.
Thursday, October 29, 2009
Developing Business Process and Integration Solutions Using Microsoft BizTalk Server
BizTalk Server (BTS) is a great product from Microsoft and it solves a lot of integration challenges, I have shared this technology with patterns and best practices to many experience BizTalk engineers and developers at Kuala Lumpur.
Course 2933A:
Developing Business Process and Integration Solutions Using Microsoft BizTalk Server 2006
Module 1: Introduction to BizTalk Server 2006
Module 2: Creating Schemas
Module 3: Creating Maps
Module 4: Deploying a BizTalk Project
Module 5: Routing BizTalk Messages
Module 6: Creating Pipelines
Module 7: Integrating with Adapters
Module 8: Creating a BizTalk Orchestration
Module 9: Automating Business Processes
Module 10: Creating Transactional Business Processes
Module 11: Deploying and Managing BizTalk Applications
Module 12:Integrating with Web Services
Module 13: Integrating Business Rules
Module 14: Enabling Business Activity Monitoring
Module 15: Integrating Trading Partners
http://www.metricsthatmatter.com/iversona54
https://www.metricsthatmatter.com/infotrek12
Course 2933A:
Developing Business Process and Integration Solutions Using Microsoft BizTalk Server 2006
Module 1: Introduction to BizTalk Server 2006
Module 2: Creating Schemas
Module 3: Creating Maps
Module 4: Deploying a BizTalk Project
Module 5: Routing BizTalk Messages
Module 6: Creating Pipelines
Module 7: Integrating with Adapters
Module 8: Creating a BizTalk Orchestration
Module 9: Automating Business Processes
Module 10: Creating Transactional Business Processes
Module 11: Deploying and Managing BizTalk Applications
Module 12:Integrating with Web Services
Module 13: Integrating Business Rules
Module 14: Enabling Business Activity Monitoring
Module 15: Integrating Trading Partners
http://www.metricsthatmatter.com/iversona54
https://www.metricsthatmatter.com/infotrek12
Tuesday, August 25, 2009
Connect WSS internal database Microsoft##SSEE using SSMS
Default Windows SharePoint Services internal database can be connected successfully using this connection from SQL Server Management Studio (SSMS):-
\\.\pipe\mssql$microsoft##ssee\sql\query
\\.\pipe\mssql$microsoft##ssee\sql\query
1) Start SSMS and key in the connection |
2) We can access the Microsoft##SSEE now! |
Saturday, July 25, 2009
ASP.NET populates Excel data without Office installed - DSOFile
Do you have any requirements to generate online Excel form from server without Office installed?
Why not download DSOFile from Microsoft website?
The Dsofile.dll files lets you edit Office document properties when you do not have Office installed
Sample Code in C#:-
DSOFile.OleDocumentPropertiesClass d = new DSOFile.OleDocumentPropertiesClass();
string file = Server.MapPath(@"Files\I9.xls");
d.Open(file, false, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);
foreach (DSOFile.CustomProperty cp in d.CustomProperties)
{
if (cp.Name == "Name")
{
object objValue = "YB test on " + DateTime.Now;
cp.set_Value(ref objValue);
}
}
d.Save();
d.Close(true);
System.Runtime.InteropServices.Marshal.ReleaseComObject(d);
Response.Write(file + " [Name] field has been updated successfully");
Why not download DSOFile from Microsoft website?
The Dsofile.dll files lets you edit Office document properties when you do not have Office installed
Sample Code in C#:-
DSOFile.OleDocumentPropertiesClass d = new DSOFile.OleDocumentPropertiesClass();
string file = Server.MapPath(@"Files\I9.xls");
d.Open(file, false, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);
foreach (DSOFile.CustomProperty cp in d.CustomProperties)
{
if (cp.Name == "Name")
{
object objValue = "YB test on " + DateTime.Now;
cp.set_Value(ref objValue);
}
}
d.Save();
d.Close(true);
System.Runtime.InteropServices.Marshal.ReleaseComObject(d);
Response.Write(file + " [Name] field has been updated successfully");
Offshore Development with Agile Software Process
No requirements can get 100% in software development, the better Software Development Process is Agile compared to Waterfall, especially in Offshore Development Business.
This article from Martin Fowler is a good one:-
Using an Agile Software Process with Offshore Development
Documentation in Agile is much lesser compared to Waterfall, but the most important in Agile is user participation.
This article from Martin Fowler is a good one:-
Using an Agile Software Process with Offshore Development
Documentation in Agile is much lesser compared to Waterfall, but the most important in Agile is user participation.
Tuesday, July 15, 2008
Community Launch for Heroes
I have presented LINQ to SQL Introduction on 28 June 2008 (Saturday) at Microsoft Auditorium, details at http://www.microsoft.com/malaysia/events/communityheroes/
Friday, July 11, 2008
BizTalk WCF Oracle Dynamic Send Port
How to implement WCF Oracle Dynamic Send Port? There is an example in Microsoft BizTalk Adapter 3.0 for Oracle Database Documentation:-
Request2(BTS.OutboundTransportType)="WCF-Custom";
Request2(WCF.Action)="http://Microsoft.LobServices.OracleDB/2007/03/SCOTT/Table/ACCOUNTACTIVITY/Select";
Request2(WCF.BindingType) = "oracleDBBinding";
Request2(WCF.UserName)="SCOTT";
Request2(WCF.Password)="TIGER";
SendPort(Microsoft.XLANGs.BaseTypes.Address)="oracledb://adapdoc/";
If you deployed the code may hit the error:-
Event Type: Error
Event Source: BizTalk Server 2006
Event Category: BizTalk Server 2006
Event ID: 5754
Date: 7/3/2008
Time: 11:21:31 AM
User: N/A
Computer: AMSDC1-S-7538
Description:A message sent to adapter "Oracle" on send port "OracleDynamicSendPort_1.0.0.0_OracleDynamicSendPort.OracleSend_Port_DynamicOracle_beec5c3523602cdb" with URI "oracledb://TNSNAME/?PollingId=1" is suspended. Error details: Value cannot be null.Parameter name: s MessageId: {A7F0A852-C315-4521-9B63-E0BFE221F4AE} InstanceID: {FF53A23E-3F21-4098-A02B-8381E6C3D851}
The solution is to add additional line in the code above:-
SendPort(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-Custom";
Then this exception will be resolved.
NOTE: to use the WCF Oracle Dynamic Send Port, the Adapter's default send handler, i.e. the BizTalk hosts must be running.
Request2(BTS.OutboundTransportType)="WCF-Custom";
Request2(WCF.Action)="http://Microsoft.LobServices.OracleDB/2007/03/SCOTT/Table/ACCOUNTACTIVITY/Select";
Request2(WCF.BindingType) = "oracleDBBinding";
Request2(WCF.UserName)="SCOTT";
Request2(WCF.Password)="TIGER";
SendPort(Microsoft.XLANGs.BaseTypes.Address)="oracledb://adapdoc/";
If you deployed the code may hit the error:-
Event Type: Error
Event Source: BizTalk Server 2006
Event Category: BizTalk Server 2006
Event ID: 5754
Date: 7/3/2008
Time: 11:21:31 AM
User: N/A
Computer: AMSDC1-S-7538
Description:A message sent to adapter "Oracle" on send port "OracleDynamicSendPort_1.0.0.0_OracleDynamicSendPort.OracleSend_Port_DynamicOracle_beec5c3523602cdb" with URI "oracledb://TNSNAME
The solution is to add additional line in the code above:-
SendPort(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-Custom";
Then this exception will be resolved.
NOTE: to use the WCF Oracle Dynamic Send Port, the Adapter's default send handler, i.e. the BizTalk hosts must be running.
Thursday, April 06, 2006
New Web Site created
Just created a new website http://www.kuala-lumpur-guide.com/ to share what is Kuala Lumpur included dark side information
Monday, February 20, 2006
WebSphere MQ Samples
Sample code for accessing Webphere MQ in Microsoft C#, VB6 and VB.NET
http://www.capitalware.biz/mq_code_csharp.html
http://www.capitalware.biz/mq_code_csharp.html
Tuesday, February 14, 2006
Project Server
I implemented a windows sharepoint services + SQL Server 2000 Reporting Services project in Australia last year, I used Smart Part http://www.microsoft.com/belux/nl/msdn/community/columns/u2u/smartpart.mspx developed for Sharepoint Web Parts, the result is good, when combining with SQL Reporting Services can become a impressive BI portal.
Anyway the new SQL Server 2005 has been released last year after end of my Project, everybody have to pick up the new skill asap to keep the competency :)
Anyway the new SQL Server 2005 has been released last year after end of my Project, everybody have to pick up the new skill asap to keep the competency :)
Friday, September 09, 2005
SQL Black Belt Advance Articles
Recently just involved in SQL Server 2000 Reporting Services Business Intelligence Development, found out a must read articles for any one who would like to master in SQL Server, the web site is at http://databasejournal.com/article.php/1459531 by William E. Pearson, III
Wednesday, April 13, 2005
MSDAORA Oracle upgrade connectivity Problem
Oracle client always have connectivity problem to the Oracle database server due to the improper configuration in C:\Oracle\Ora81\network\ADMIN\TNSNAMES.ORA (Assume you did not change the default install folder)
Sometimes you may experience all the configuration are fine, you also can use TNSPING and SQLPLUS to access the ORACLE server without problem, but your Application using MSDAORA provider is facing problem to access the Oracle Server, you may get the error like:-
Error while trying to retrieve text for error ORA-03121
This is usually happen after you upgraded your Oracle client, you have restarted your machine, all the TNSNAMES.ORA entries are correct, everything is fine except your application, either ASP, ASP.NET, VB.NET or any application that use MSDAORA provider.
Why the problem happen is, after you upgraded your Oracle client, your MSDAORA still pointing to the old Oracle version, that's why the problem occurs.
To resolve this problem, goto your machine MSDAORA home C:\Program Files\Common Files\System\Ole DB folder, you will see there are some .reg files:-
mtxoci81_winnt.reg
mtxoci81_win2k.reg
mtxoci7x_winnt.reg
mtxoci7x_win2k.reg
If your Oracle client is 8.1 with Windows 2000 and above, double click the mtxoci81_win2k.reg file to register the new registry for the newer client. Then restart your machine, the problem will be solved automatically.
The content of the mtxoci81_win2k.reg is
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\MTxOCI]
"OracleXaLib"="oraclient8.dll"
"OracleSqlLib"="orasql8.dll"
"OracleOciLib"="oci.dll"
The nice thing about Oracle is, once the Oracle problem is resolved, you will enjoy with Oracle.
Sometimes you may experience all the configuration are fine, you also can use TNSPING and SQLPLUS to access the ORACLE server without problem, but your Application using MSDAORA provider is facing problem to access the Oracle Server, you may get the error like:-
Error while trying to retrieve text for error ORA-03121
This is usually happen after you upgraded your Oracle client, you have restarted your machine, all the TNSNAMES.ORA entries are correct, everything is fine except your application, either ASP, ASP.NET, VB.NET or any application that use MSDAORA provider.
Why the problem happen is, after you upgraded your Oracle client, your MSDAORA still pointing to the old Oracle version, that's why the problem occurs.
To resolve this problem, goto your machine MSDAORA home C:\Program Files\Common Files\System\Ole DB folder, you will see there are some .reg files:-
mtxoci81_winnt.reg
mtxoci81_win2k.reg
mtxoci7x_winnt.reg
mtxoci7x_win2k.reg
If your Oracle client is 8.1 with Windows 2000 and above, double click the mtxoci81_win2k.reg file to register the new registry for the newer client. Then restart your machine, the problem will be solved automatically.
The content of the mtxoci81_win2k.reg is
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\MTxOCI]
"OracleXaLib"="oraclient8.dll"
"OracleSqlLib"="orasql8.dll"
"OracleOciLib"="oci.dll"
The nice thing about Oracle is, once the Oracle problem is resolved, you will enjoy with Oracle.
ADO filter with NULL value
NULL value in database means no storage in the cell, if you use ADO to query the data and you would like to filter the NULL value, it will be a challenge for a lot of programmers.
Let's see the following code:-
dim rs, strSQL
strSQL = "SELECT EmployeeId, ReportsTo FROM Employees"
Set rs = CreateObject("ADODB.Recordset")
rs.cursorlocation = 3 ' -- adUseClient
rs.Open strSQL, connobj ' -- Assume the connobj already has open connection
do while not rs.eof
rs.movenext
loop
rs.close
The code above is retreiving data from MS SQL Server Northwind database, it tries to get the employeeId and superior employee Id (reportsTo column).
Let's say the requirement is those employee without superior display in one panel and those employee with superior display in another panel.
I believe no one want to query the database two times by using SQL query "SELECT EmployeeId, ReportsTo From Employees WHERE ReportsTo IS NULL" and "SELECT EmployeeId, ReportsTo From Employees WHERE ReportsTo IS NOT NULL", so we will query one time from the database by re-using the above code.
You will add another code before the while loop:-
rs.filter = "ReportsTo IS NULL"
Immediately you will get this error:-
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
The reason being is because ADO Filter does not support "IS" and "NULL" statement, even you tried to use the filter as ISNULL(ReportsTo, 'N/A') = 'N/A' also get the same problem.
The only solution to this is back to the SQL query, change the query as
SELECT EmployeeId, ISNULL(ReportsTo, 'N/A') FROM Employees
Then the rs.filter use ReportsTo = 'N/A' will solve the problem, the whole code is shown below:-
dim rs, strSQL
strSQL = "SELECT EmployeeId, ISNULL(ReportsTo, 'N/A') FROM Employees"
Set rs = CreateObject("ADODB.Recordset")
rs.cursorlocation = 3 ' -- adUseClient
rs.Open strSQL, connobj ' -- Assume the connobj already has open connection
rs.Filter = "ReportsTo = 'N/A'"
do while not rs.eof
' -- Display Data in Superior Panel
rs.movenext
loop
rs.Filter = "ReportsTo <> 'N/A'"
do while not rs.eof
' -- Display Data in Subordinate Panel
rs.movenext
loop
rs.close
Cheers!
Let's see the following code:-
dim rs, strSQL
strSQL = "SELECT EmployeeId, ReportsTo FROM Employees"
Set rs = CreateObject("ADODB.Recordset")
rs.cursorlocation = 3 ' -- adUseClient
rs.Open strSQL, connobj ' -- Assume the connobj already has open connection
do while not rs.eof
rs.movenext
loop
rs.close
The code above is retreiving data from MS SQL Server Northwind database, it tries to get the employeeId and superior employee Id (reportsTo column).
Let's say the requirement is those employee without superior display in one panel and those employee with superior display in another panel.
I believe no one want to query the database two times by using SQL query "SELECT EmployeeId, ReportsTo From Employees WHERE ReportsTo IS NULL" and "SELECT EmployeeId, ReportsTo From Employees WHERE ReportsTo IS NOT NULL", so we will query one time from the database by re-using the above code.
You will add another code before the while loop:-
rs.filter = "ReportsTo IS NULL"
Immediately you will get this error:-
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
The reason being is because ADO Filter does not support "IS" and "NULL" statement, even you tried to use the filter as ISNULL(ReportsTo, 'N/A') = 'N/A' also get the same problem.
The only solution to this is back to the SQL query, change the query as
SELECT EmployeeId, ISNULL(ReportsTo, 'N/A') FROM Employees
Then the rs.filter use ReportsTo = 'N/A' will solve the problem, the whole code is shown below:-
dim rs, strSQL
strSQL = "SELECT EmployeeId, ISNULL(ReportsTo, 'N/A') FROM Employees"
Set rs = CreateObject("ADODB.Recordset")
rs.cursorlocation = 3 ' -- adUseClient
rs.Open strSQL, connobj ' -- Assume the connobj already has open connection
rs.Filter = "ReportsTo = 'N/A'"
do while not rs.eof
' -- Display Data in Superior Panel
rs.movenext
loop
rs.Filter = "ReportsTo <> 'N/A'"
do while not rs.eof
' -- Display Data in Subordinate Panel
rs.movenext
loop
rs.close
Cheers!
Subscribe to:
Posts (Atom)