Nisses blog

Slå mig, älska mig

Archive for May, 2009

Insert large amount of data in MSSQL field with PHP

There is some what of a problem when inserting huge amounts of text in a textfield. I’ve working on a site right now where the user will edit the whole contet of the page itself with the help of FCKEditor.
I started with an Access Database and outgrew that one in 20minutes, exported the database to a SQL 2005 database. The PM value in Access will be ntext in SQL, this is wrong and it should be just text. My next issue is that the maxtextsize in php is to small, so we need to change that in the php.ini

mssql.textlimit = 65536,
mssql.textsize = 65536;

Then you also need to change the textsize of the queries insert this code before the queries or if you work with classes you could add this code to the constructor.

mssql_query ( 'SET TEXTSIZE 65536' , $myConn ); // myConn is the connection identifier for the connection.
ini_set ( 'mssql.textlimit' , '65536' ); // Not needed but I set them anyway
ini_set ( 'mssql.textsize' , '65536' ); // Not needed but i set them anyway

 

This solved this for me, i’m not sure how this works with MySQL, if you do, please leave a comment.

posted by Nisse in Code and have No Comments

Return affected rows from a stored procedure

I’m working on a site where I use alot of stored procedures and I wish to log the results of the datamining. So I would like to get affected rows sent back from the stored procedure. I googled and found this thread which had a comprihensive exampel.http://www.ozgrid.com/forum/showthread.php?t=79766

Just a small tip Smile

posted by Nisse in Code and have No Comments

Convert NCSA logs to W3C logs

If you set up your IIS sites and then come to the conclusion that the logfiles are in the wrong logformat then you’re in a bit of a problem. I found a VB script that solves this, i think i found it on the IIS blog but can’t rembember.

Put this file in the logs directory and run it. I’ll convert you NCSA logs to W3C logs and for me that helped me alot since I use Smarter Stats on our webserver.

NCSA to W3C.vbs (2.66 kb)

posted by Nisse in Technical and have No Comments

Microsoft Provisioning System(MPS) control panel

I’ve recently deployed an MPS installation for hosting at our company. There is a small ASP.NET site that’s included in this software but it’s not sufficient to use in a production enviroment. There is alot of control panels out on the market but they are expensive. For us using smaller setup we have the choice of using provtest.exe and manualy edit the XML-files so we can edit the information in the provisioning system.

I’ve started development for a controlpanel that’s supposed to be easy and without support for sharepoint. The main idea for this application is to add a new organization to the Exchangeserver, edit users, edit plans and handle the accounts in the Active Directory. The application is not ready and i would not even say that it’s in Alpha stage but there is some screens and at the moment you can edit som settings for each Exchange account. The goal is to have something ready for release as a free application. But there are som major goals overcome first. Make it fully functional as a Exchange Account editor and edit the source code so it’s not embaressing to release

Start up view. Select customer and press get all to query the MPS server.

 

Edit user view

 

Edit aliases for a user.

There is work being done but it’s slow. I’m learning winforms and on the same time working with MPS and Provisioning databases. Exciting but slow progress.

I started using the provtest.exe and genereated XML-files. I knew that i could use the SDK supplied from Microsoft but did not know how to make it work. I’ve got alot of help in the asp.net forums and now i use DLLs from Microsoft.

posted by Nisse in Code,Technical and have No Comments

Useful tools

There is alot of usefull tools availeble for techs and some of them are applications we use daily. Such an application is PuTTy or Nutty which is a better choise since texts that are links open in default browser if you click them. Download them and have a go or use them as a portable app on you memory stick.

Angry IP-Scanner is a very fast and usefull tool to probe the network for machines. A tip is to go to options and raise number of threads to 2000(max) to scan a hole C-NET winthin seconds.

SIW – System information for windows This tool probes the computer for information about licenses and installed programs. When you need a password that’s masked you could use the eureka function. This password unmasker don’t work for Mozilla Firefox though. If you know one that does, please comment or send me an email.

posted by Nisse in Technical and have No Comments

Startup phase!

This is the first post and i’m in the startup phase of this blog. I’ve been struggeling to get the BlogEngine work with SQL instead of XML which is the default storage method.
There is not that much of information about how to enable this but the Web.Conf is preatty easy.

Follow the link to get more information on how to enable SQL support. http://blogengine.codeplex.com/Wiki/View.aspx?title=SQLServerBlogProvider&referringTitle=Home
You need to make sure that Microsoft SQL Server has TCP/IP connections enabled.

DHR3D9KE3TBQ

posted by Nisse in OS and have No Comments