Solved

Restoring an old web asp application on windows server 2003

Posted on 2012-12-26
14
186 Views
Last Modified: 2013-10-11
I'm restoring an old asp application on a windows server 2003, this application use an Access file to its operation.

I could setup asp again on the server but when we execute the pages, the server said that the page can not be showed, a http error 500 appears.

The default.asp page is displaying without problems, that is a login user page, then we put the username and password that is sent to another page called Authentication.asp then the error 500 occurs. At this point I don't know if I miss a configuration or we need to setup another application or what.

I check the code, and probably the page crash in this place:

	
        lNextASP = "Default.asp"
	lUserName = Request("tNombre")
	lPassword = Request("tPwd")
	Set gDataBase = Server.CreateObject("ADODB.Connection")
	gDataBase.Open Application("dbOpenLine")
	Set gDataSet = Server.CreateObject("ADODB.Recordset")
	gSql = "SELECT U.IdUsuario, U.Clave, U.Tipo, HM.IdHospital FROM tUsuarios AS U INNER JOIN tHospMed AS HM "
	gSql = gSql & "ON U.IdUsuario = HM.IdUsuario "
	gSql = gSql & "WHERE U.Cancel = 0 AND U.Clave = '" & lUserName & "' AND U.Pwd = '" & lPassword & "'"
	gDataSet.Open gSql, gDataBase

Open in new window



I know that is an old application based on asp classic and VB language, but now I don't have ideas on how to setup this old fashion asp application.

Additionally I tried to check what is the error on the server but I notice that the windows server 2003 doesn't have a log error for the web server. Is it possible to setup a log error file to the web server?

Somebody can help me?. Thank you
0
Comment
Question by:CloudHelpdeskOne
  • 7
  • 7
14 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 270 total points
ID: 38721968
It looks like a database issue.

>gDataBase.Open Application("dbOpenLine")

Does Application("dbOpenLine") return anything?
0
 

Author Comment

by:CloudHelpdeskOne
ID: 38722231
I guess that this part of my problem, but I don't know how to check what this function return, because I don't know how to check this, there is not any error log to check, and I don't have full experience with asp.

Any suggestion to know how to check the output of this function? Even I don't understand this part of the code: Application("dbOpenLine")

1. I found out function "Application" and I didn't find any  reference in the method Open
2. "dbOpenLine" doesn't seem to be and Access file, the people that give to me this application to restore, gave me a mdb file which name is not dbOpenLine.

So I'm a little lost about how to debug this part of the code.
Could you help me to figure out what can I do?

Thank you
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38722243
Application is one of the built in ASP objects. Application("name") returns a value that was previously stored with that name so

Application("DB") = "blablabla"

and the

Application("DB") will return "blablabla"


Is this Application("dbOpenLine") being used anywhere else?
0
 

Author Comment

by:CloudHelpdeskOne
ID: 38722396
Well, within the page, no previous reference to this object. Neither, exist any reference to an include file with this code

These are the first lines of the file.

<%Option Explicit%>
<%

Dim lName, lUserName, lPassword, lIP, lNextASP
Dim gDataSet, gSql, gError, gDataBase, lDataSet, lExist

	lNextASP = "Default.asp"
	lUserName = Request("tNombre")
	lPassword = Request("tPwd")
	Set gDataBase = Server.CreateObject("ADODB.Connection")
	gDataBase.Open Application("dbOpenLine")
	Set gDataSet = Server.CreateObject("ADODB.Recordset")
	gSql = "SELECT U.IdUsuario, U.Clave, U.Tipo, HM.IdHospital FROM tUsuarios AS U INNER JOIN tHospMed AS HM "
	gSql = gSql & "ON U.IdUsuario = HM.IdUsuario "
	gSql = gSql & "WHERE U.Cancel = 0 AND U.Clave = '" & lUserName & "' AND U.Pwd = '" & lPassword & "'"
	gDataSet.Open gSql, gDataBase
	If gDataSet.EOF Then
		gError = "No account found"
	Else
.
.
.

Open in new window


There is another way to declare the value of Application ("dbOpenLine") without any reference in the code?
Where should I need to look for?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38722485
Try and search through all files to see if there are other references which set this value rather than using it.
0
 

Author Comment

by:CloudHelpdeskOne
ID: 38735770
I found 174 files that use Application("dbOpenLine"), like:

gDataBase.Open Application("dbOpenLine")
lDataBase.Open Application("dbOpenLine")
gDBDiag.Open Application("dbOpenLine")
gDBDiagnos.Open Application("dbOpenLine")

but nothing about

Application("dbOpenLine") = somevalue

Then is it possible that I don't have a good backup?

How and where I need to define this object? In the same page where I use this object?
Is this right ? :
Application("dbOpenLine") = "database1.mdb"


Thank you for your help
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38738315
You can set it once in a session and use it everywhere

http://www.w3schools.com/ado/met_conn_open.asp
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:CloudHelpdeskOne
ID: 38739224
I setup in Administration of ODBC data the MS Access driver with the path to the database as follow:

c:\Inetpub\Data\dbOpenLine.mdb

ODBC Windows box

Then I changed the code to this way:

    Application("dbOpenLine") = "dbOpenLine.mdb"

	lNextASP = "Default.asp"
	lUserName = Request("tNombre")
	lPassword = Request("tPwd")
	Set gDataBase = Server.CreateObject("ADODB.Connection")
	gDataBase.Open Application("dbOpenLine")
   

Open in new window


But nothing happened, when we requested the page we received an internal server error

then I changed the code again:

    
	lNextASP = "Default.asp"
	lUserName = Request("tNombre")
	lPassword = Request("tPwd")
	Set gDataBase = Server.CreateObject("ADODB.Connection")
	gDataBase.Open "dbOpenLine"

Open in new window


But again we received an internal server error.
Any suggestion of what is missing?

Thank you
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38740215
What happens if you change

gDataBase.Open "dbOpenLine"

to

gDataBase.Open "websitedb"

?
0
 

Author Comment

by:CloudHelpdeskOne
ID: 38742282
Nothing happened, again the error 500, internal server error.

Is there a way to check a error log file for iis?

Is ther some error log file that shows why iis display an internal server error?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38742352
0
 

Author Comment

by:CloudHelpdeskOne
ID: 38761387
Thank you for your post, I found the log file of iis and I found the following error:

2012-12-26 06:56:34 W3SVC1 127.0.0.1 POST /Authentication.asp |22|80004005|[Microsoft][Administrador_de_controladores_ODBC]_No_se_encuentra_el_nombre_del_origen_de_datos_y_no_se_especificó_ningún_controlador_predeterminado 80 - 127.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322) 500 0 0

The error is: Data source name not found and no default driver specified
Error: 80004005

I google this error but I found suggestions to windows server NT and 2000, that I checked them to use in the server and these instruccions are not useful on windows server 2003.

Suggestions?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38763503
But you did create the websitedb datasource right?
0
 

Author Comment

by:CloudHelpdeskOne
ID: 38773124
Yes, I did. I did like the images above can show.
I going to check this again.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now