[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

Leading Zero is being removed in IIS6

Hi,

I got an ASP page (Classic ASP) that was designed 6 years ago to import data to SQL 2000. the page was running on Windows 2000 IIS 5. I want to upgrade the server to Windows 2003 R2 and move the page there but I came across an issue when I was testing it.

It seems that IIS 6 is removing the leading zero from the data.

I created a file called test.csv in notepad:

field1,field2
01233,123123

I used the application on IIS 5 and data got imported to SQL just fine. Zero was not removed.

I then use the same file in IIS 6 and leading zero in 01233 is being remove when data are being imported.

Data are getting import to the same SQL server.

Is this an IIS setting or do I need to get a programmer to fix the application?

if IIS setting how can I fix this?


Thanks

0
ezzadin
Asked:
ezzadin
  • 3
  • 2
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
I'm probably that it is not an IIS setting.  But the ASP interpreter for IIS6 may not be exactly the same as for IIS5.1.  If '01233' can be viewed as a number at any point, then the leading zero gets removed because it has no value as a number.  This can happen in ASP or .NET or PHP or especially when you import it into Excel.  When it is my choice, I always start fields like that with a letter which will 'automatically' make it a text field.  Numbers used as 'names' with leading zeros are often a problem.

We might be able to give more specific help if you post the ASP code.
0
 
ezzadinAuthor Commented:
thanks. there are so many processes and ASP pages in there and I'm not even sure which is the correct one.

I will try to contact the developer who designed it and see.

I actually tried the same thing using txt file and it worked for both IIS 5 and IIS 6

"field1","field2"
"01233","123123"

weird.
0
 
ezzadinAuthor Commented:
this wasn't an iss issue as you mentioned Dave. The following registry modification fixed the problem:

REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text]
"ImportMixedTypes"="Text"
"MaxScanRows"=dword:00000000

MaxScanRows will define how many rows to scan to decide the column type and once you set it to zero it will ignore that.

Thanks
0
 
ezzadinAuthor Commented:
Registry change fixed the issue
0
 
Dave BaldwinFixer of ProblemsCommented:
Thanks for the points.  That's an interesting registry issue.  "ImportMixedTypes"="Majoritytype" and "MaxScanRows"=25 on my computer.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now