7 Replies - 1015 Views - Last Post: 17 February 2009 - 02:57 AM Rate Topic: -----

#1 Opex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-February 09

Is it possible to use an MDF online for an ASP web page?

Posted 17 February 2009 - 01:48 AM

Hi,

I hired a couple of coders to make a sort project that works very much like how tables come out and the data within can be sorted at torrent sites such Mininova and Demonoid. In this case, the data are awards entries for an event my company manages. The project also includes user registration and login.

They apparently used ASP, Dreamweaver and SQL Server Management Studio Express.

They were able to make the project work offline, but they are now finding difficulty making it online in one of our domains.

I cannot express enough my grief over this matter, though a previous coder (vb.net) myself, I do not have time to code anymore (more on management now) and I am really disappointed as to how this paid project is coming down into my own hands.

To start, when I try to load the .asp page, Error 500 occurs. I'm pretty sure this is concerned with initiating the db connection. Here is the connection string they put in:

set connect=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
set rs2=server.CreateObject("adodb.recordset")
connect.open "DSN=dhaboss"


I'm not really sure what dhaboss refers to. The database file is an MDF paired with the usual *log.LDF. I could really use some help over this, as I'll be needing to present this project soon to my director.

I have contacted my host (INetU) to enable ASP support in my domains and they already had. Prior to this, the ASP pages appeared with code snippets on them. After enabling ASP, Error 500 now occurs.

Thank you very much for your time.

Is This A Good Question/Topic? 0
  • +

Replies To: Is it possible to use an MDF online for an ASP web page?

#2 pr4y  Icon User is offline

  • Location: 127.0.0.1
  • member icon

Reputation: 35
  • View blog
  • Posts: 621
  • Joined: 19-September 08

Re: Is it possible to use an MDF online for an ASP web page?

Posted 17 February 2009 - 01:53 AM

Do you have any more code that you could show other than this? While this may be the problem... There shouldn't be 500 errors as a result of a mistreated connection error. ASP should atleast be spitting out some debug information.


Try adding some DEBUG settings to your file header:

<%@ Page Language="C#" Debug="TRUE" %>




Let me know any debug information you can provide.

Thanks!
Was This Post Helpful? 1
  • +
  • -

#3 Opex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-February 09

Re: Is it possible to use an MDF online for an ASP web page?

Posted 17 February 2009 - 01:56 AM

Hi pr4y,

Thank you for your prompt response.

I'm sorry for the misleading term, I meant a "500 Internal Server Error". If I may post, here is the URL which will show you the error page (http://www.publishingconvention.com/award_listings/index.asp).

I will try placing the statement you posted. Thanks.
Was This Post Helpful? 0
  • +
  • -

#4 pr4y  Icon User is offline

  • Location: 127.0.0.1
  • member icon

Reputation: 35
  • View blog
  • Posts: 621
  • Joined: 19-September 08

Re: Is it possible to use an MDF online for an ASP web page?

Posted 17 February 2009 - 01:58 AM

I understood what you meant. I was saying there shouldn't be a "500 Internal Server Error" as a result of a mistreated connection.


Anyways, like I said try adding that debug line to your script to see if you can get any more specific of an error other than just the "500 Error".


If not, we may need to see a bit more code than this.
Was This Post Helpful? 1
  • +
  • -

#5 Opex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-February 09

Re: Is it possible to use an MDF online for an ASP web page?

Posted 17 February 2009 - 02:38 AM

Thank you for waiting.

They gave me an update on the code - which still does not work. They seemed to have modified the connection string. I also tried putting the debug statement but to no avail.


<% 

Dim connect
Dim rs
Dim rs2
Dim rs3
Dim errmsg0
Dim errmsg1
Dim errmsg2
Dim s_name
Dim pwd
Dim s_name2
Dim pwd2
Dim ncomp
Dim ncount
Dim nusers
Dim nawcomp
Dim nacat
Dim i




set connect=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
set rs2=server.CreateObject("adodb.recordset")
set rs3=server.CreateObject("adodb.recordset")

connect.ConnectionString="Driver={SQL Server}; Server=ftp://ftp.xxx.com/xxx/; Database=tbl_sp; Uid=xxx; Pwd=xxx;"


	
	
	
Session("userid")=""

if Session("username") = "" then
	errmsg2 = "Your session has expired. Please try again."
	Session("sessionexpired") = ""
	Session("username")="" 
else
	Session("username")="" 
end if
 
if request.Form("Submit")<>"" then

	s_name = Request.Form("username")
	pwd = Request.Form("password")
	s_name2 = s_name
	pwd2 = pwd
	
	dim badChars(10)
	badChars(0)="xp_"
	badChars(1)="select"
	badChars(2)="drop"
	badChars(3)="insert"
	badChars(4)="delete"
	badChars(5)="^"
	badChars(6)="["
	badChars(7)="]"
	badChars(8)="`"
	badChars(9)="\"
	
	for i = 0 to 9
	
	s_name = replace(s_name, badChars(i), "")
	pwd = replace(pwd, badChars(i), "")

	next
	

		if s_name <> s_name2 then
		errmsg1="Only alphanumeric characters for screen name are accepted"
		errs=1
		else
		errs=0
		end if
		if pwd <> pwd2 then
		errmsg2="Only alphanumeric characters for password are accepted"
		errs=1
		else
		errs=0
		end if
		
if request.Form("username") <> "" and request.Form("password") <> "" and errs=0 then

	rs.open "SELECT * from reg where screen_name='" & Request.Form("username") & "' and password='" & Request.Form("password") & "'",connect,3,3
	if rs.recordcount <> 0 then
		user_ID = rs("id_no")
		rs2.open "SELECT * from reg where id_no='" & user_ID & "'",connect,3,3
		Session("username")=Request.Form("username")
		Session("userid")=rs("user_stat")
		Session.Timeout=60
		response.redirect("irrishaimasen2.asp")

	else
		errmsg0="Incorrect Username or Password. Please try again."
	end if
else
		errmsg0="Complete all fields."
end if
Session("username")=""
end if


	
	

%>

Was This Post Helpful? 0
  • +
  • -

#6 pr4y  Icon User is offline

  • Location: 127.0.0.1
  • member icon

Reputation: 35
  • View blog
  • Posts: 621
  • Joined: 19-September 08

Re: Is it possible to use an MDF online for an ASP web page?

Posted 17 February 2009 - 02:41 AM

Is the code you provided all within the <script runat="Server"></script> ??


I am less and less inclined to believe it is a coding problem rather than a server problem... I've never seen a 500 error as a result of bad code. Although I will keep poking at it for now.
Was This Post Helpful? 1
  • +
  • -

#7 Opex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-February 09

Re: Is it possible to use an MDF online for an ASP web page?

Posted 17 February 2009 - 02:53 AM

I see, so you're saying the connection string appears correct?

Those script tags are not in the code, should they be there? Thank you very much for your efforts Pr4y.
Was This Post Helpful? 0
  • +
  • -

#8 pr4y  Icon User is offline

  • Location: 127.0.0.1
  • member icon

Reputation: 35
  • View blog
  • Posts: 621
  • Joined: 19-September 08

Re: Is it possible to use an MDF online for an ASP web page?

Posted 17 February 2009 - 02:57 AM

I'm just saying that ASP webpages are in the following format:

<%@ Page Language="C#" Debug="True" %>
<script runat="server">

	void Page_Load()
	{
		' Some C# script
	}

</script>
<html>




I wasn't sure if that's some form of short-tags or something... but I've always designed things differently. Just for sticks and giggles try it out for me.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1