Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: codes shown


Message #1 by "Enzo" <enzo@r...> on Tue, 19 Jun 2001 03:03:44 +0800
What seems to be wrong on an ASP page if it shows the codes on the 

browser instead of translating codes????



Enzo



Message #2 by =?iso-8859-1?Q?H=E5kan_Frennesson?= <hakan@c...> on Tue, 19 Jun 2001 00:21:09 +0200
Hi!



Just to check:

Are the pages on a webserver that runs ASP?

Is the webserver running?

Have you named the pages with the asp extension?

Did you surround the code with % signs?

Have you declared the scripting language?



Some code please...



Hakan



-----Original Message-----

From: Enzo [mailto:enzo@r...]

Sent: den 18 juni 2001 21:04

To: ASP Databases

Subject: [asp_databases] codes shown





What seems to be wrong on an ASP page if it shows the codes on the 

browser instead of translating codes????



Enzo





Message #3 by Lakefront21k@a... on Mon, 18 Jun 2001 19:07:53 EDT
In a message dated 6/18/2001 4:21:17 PM Central America Standard Tim, 

hakan@c... writes:





> 



> Is the webserver running?

> Have you named the pages with the asp extension?

> Did you surround the code with % signs?

> Have you declared the scripting language?





Yes to all of the above, but did not declare the scripting lang, thought we 

did not have to 

per pg 695 of a VB book using vb6...because default script lang is vb script

code is as follows



 <%  ' @Language=VBScript%>

<html>

<head>

<title>Home Page</title>

</head>

<body>

<p>This line from HTML</p>

<hr>

<p>Next line from ASP will work<br>

if ASP extensions installed correctly:<br>

<%

  response.write "<b>test with tom</b>"

 

%>

<hr>

<p>Next line from ADO will work if a DSN named sailors has been set<br>

for the database which is named SAILORS.MDB.</p>

<%



Dim cn

Dim rs

Dim sSQL



'THIS WORKED

Set cn = Server.CreateObject("ADODB.Connection")

cn.open = "DSN=Sailors"

Set rs = cn.Execute("SELECT * FROM Clubs ")    

response.Write "<b>" & rs("ClubName") & "</b>"



%>



The code  from the WROX "Beginning ASP DataBases",1999 edition, p.75 

for the Sailor DB that is in the Access '97 format works in both the '97 

format and the upgrade to Access 2000.  My ASP script runs under IIS 5.0 in 

Windows Advanced 2000 Server, and Windows Professional 2000.  



However, NorhtWind, running under Access 2000, does not work.  We use the 

exact same code changed only the DSN and the table information.   The error 

we get is 



"HTTP 500.100 Internal Server Error -0 ASP error Internet Information Services



OLEDB Provider for ODBC Drivers (ox80040e14) [Microsoft][ODBC Microsoft 

Access Drivers]

Syntax Error in Clause  /testsailor.asp, line 31 .

Browser type....."



We have installed the Windows SP#2, and the MDAC 2.6 upgrades.   



Have tried to debug and trace by using DSN-less syntax for connection string. 

 But that caused a different error: 



Microsoft VBScript runtime (0x800A01FA)



Please help...Peter

    







Message #4 by =?iso-8859-1?Q?H=E5kan_Frennesson?= <hakan@c...> on Tue, 19 Jun 2001 10:48:59 +0200
Hi!



Is this correct?

cn.open = "DSN=Sailors"



I think it should read

cn.open "tablename", "DSN=Sailors"



Hakan



-----Original Message-----

From: Lakefront21k@a... [mailto:Lakefront21k@a...]

Sent: den 19 juni 2001 01:08

To: ASP Databases

Subject: [asp_databases] RE: codes shown





In a message dated 6/18/2001 4:21:17 PM Central America Standard Tim,

hakan@c... writes:





>



> Is the webserver running?

> Have you named the pages with the asp extension?

> Did you surround the code with % signs?

> Have you declared the scripting language?





Yes to all of the above, but did not declare the scripting lang, thought we

did not have to

per pg 695 of a VB book using vb6...because default script lang is vb script

code is as follows



 <%  ' @Language=VBScript%>

<html>

<head>

<title>Home Page</title>

</head>

<body>

<p>This line from HTML</p>

<hr>

<p>Next line from ASP will work<br>

if ASP extensions installed correctly:<br>

<%

  response.write "<b>test with tom</b>"



%>

<hr>

<p>Next line from ADO will work if a DSN named sailors has been set<br>

for the database which is named SAILORS.MDB.</p>

<%



Dim cn

Dim rs

Dim sSQL



'THIS WORKED

Set cn = Server.CreateObject("ADODB.Connection")

cn.open = "DSN=Sailors"

Set rs = cn.Execute("SELECT * FROM Clubs ")

response.Write "<b>" & rs("ClubName") & "</b>"



%>



The code  from the WROX "Beginning ASP DataBases",1999 edition, p.75

for the Sailor DB that is in the Access '97 format works in both the '97

format and the upgrade to Access 2000.  My ASP script runs under IIS 5.0 in

Windows Advanced 2000 Server, and Windows Professional 2000.



However, NorhtWind, running under Access 2000, does not work.  We use the

exact same code changed only the DSN and the table information.   The error

we get is



"HTTP 500.100 Internal Server Error -0 ASP error Internet Information

Services



OLEDB Provider for ODBC Drivers (ox80040e14) [Microsoft][ODBC Microsoft

Access Drivers]

Syntax Error in Clause  /testsailor.asp, line 31 .

Browser type....."



We have installed the Windows SP#2, and the MDAC 2.6 upgrades.



Have tried to debug and trace by using DSN-less syntax for connection

string.

 But that caused a different error:



Microsoft VBScript runtime (0x800A01FA)



Please help...Peter




  Return to Index