martes, 11 de octubre de 2016

80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

We have a website application that uses a 32 bit OCX reference and We were getting the nice error

80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

This was case escenario:
We were developing using  VS 2010 Asp.net  running it as Administrator
Server was Windows 2012 R2 64 bits
We were using an OCX library that works in 32 bit, We installed this Library as Administrator.

Still we were getting the error.

80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Another error We were getting was STDOLE.DLL can not be copied to the Refence folder.


Remember, the Library worked in a 32 bit app.



Go to the  Application Pools from the IIS Manager


Right click in the application Pool , select Advanced Settings.



Enable 32-Bit applications SET IT TO TRUE

Set all the Applications Pool the same way.




Then go to your Web Application, right click on it and select Manage application then Advanced Settings



There Select the Application Pool you will be using for the Web Application you are having problems.


Compile, test, celebrate!

jueves, 25 de agosto de 2016

LinkedIn Background Image

Go to Google Image Search and search for anything you like to be your image background.

then use any capture screen software you like to capture the best combination you like,
I use screenshot captor
https://www.donationcoder.com/Software/Mouser/screenshotcaptor/

and no I am not getting any money for this :) I wish I could

here some examples:

Some Peruvian beaches



Do you like Software Companies?




and this is my current linkedin background



simple and nice. I am not a Graphic Designer so this approach will work for me.

lunes, 8 de agosto de 2016

Tsql Tips

Sometimes you need random numbers from 1 to 1000 and without duplicated numbers, here is the link:

http://sqlperformance.com/2013/09/t-sql-queries/random-collisions

Backup all databases at once from a SQL Server?
https://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/

Reindex all tables in a DB TSQL
http://blog.sqlauthority.com/2015/02/15/interview-question-of-the-week-007-how-to-reindex-every-table-of-the-database/


lunes, 25 de enero de 2016

Bulk Insert Notes

How to Fix Error : 
Msg 4866, Level 16, State 7, Line 2
The bulk load failed. The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly.
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 2
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".


Part of my format file is like this

10.0
59
1       SQLCHAR             2       20      ""   1     "RecordType"                        SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             2       50      ""   2     "FullName"                           SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             2       9       ""   3     "CompanyID"                         SQL_Latin1_General_CP1_CI_AS


Solution:
So I changed this "             2       " to "             0       "

10.0
59
1       SQLCHAR             0       20      ""   1     "RecordType"                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     "FullName"                           SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     "CompanyID"                          SQL_Latin1_General_CP1_CI_AS

Please notice the differences line per line 



/*****************************************************/
How to Fix Error : 
Msg 4823, Level 16, State 1, Line 3
Cannot bulk load. Invalid column number in the format file "C:\COMPANIES.fmt".

Format File is like this:

10.0
59
1       SQLCHAR             0       20      ""   1     [RecordType]                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     FullName                             SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     [CompanyID]                          SQL_Latin1_General_CP1_CI_AS
4       SQLCHAR             0       3       ""   4     [Column 3]                           SQL_Latin1_General_CP1_CI_AS

Solution:
Changed the Square Brackets for double quotes

10.0
59
1       SQLCHAR             0       20      ""   1     "RecordType"                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     FullName                             SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     "CompanyID"                          SQL_Latin1_General_CP1_CI_AS
4       SQLCHAR             0       3       ""   4     "Column 3"                           SQL_Latin1_General_CP1_CI_AS


/*****************************************************/
How to Fix Error : 
Msg 4862, Level 16, State 1, Line 3
Cannot bulk load because the file "C:\crane\COMPANIES.fmt" could not be read. Operating system error code (null).

Solution:
Open your format file press Ctrl-End you should be going to the last line.
If your last line is a column definition you need to go to the end of that line, press enter and Save it.
so you must have an EMPTY LAST LINE in your file.




lunes, 14 de diciembre de 2015

Rmcobol 85 tips

Couple of things.

I was looking for a copy of the manual.

https://www.yumpu.com/en/document/view/9317270/rm-cobol-users-guide-second-edition-micro-focus

I have several index files to convert to sequential you can do it in a batch this is the command line.

runcobol recover2 A="INDEXFILE.INX, SEQUENTIALFILE.TXT ,NOSUB"


jueves, 10 de diciembre de 2015

Export Data From Crystal Reports to Excel - Work Around

So I was requested to Export the Data from a Crystal Report to Excel with Headers.
This is a work around not the perfect solution. It worked for my request, maybe it will for you as well.

The report uses  a DataTable as DataSource.

What I did I export the DataTable as comma delimited  file using this method

DataTable2CSV - Saving a DataTable to a CSV file

http://www.devx.com/vb2themax/Tip/19703

Again it worked for me. I got the data and the Headers.

The Report was simple straight forward not a Master - Detail Report.


Operation not yet implemented - Crystal Reports

I have this problem when the users use EXPORT AS A PDF from a Crystal Report.
The solution was simple
Grab the Arial and Times Roman Font from a XP Machine put them into a Flash Drive and copy them to the machine you are getting the problem. That will fix it.

What causes this problem? Microsoft update the fonts and they are "not compatible" with CR.
A work around is changing all the Fonts in your report to something else, mmmmm User will not wait for that I will stick with the XP Solution. I can not upload them here but you can send me a email I will send them to you if you need them.

Have a good one