Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: RE: access_asp digest: January 17, 2002


Message #1 by "raja" <raja.ravipati@r...> on Fri, 18 Jan 2002 10:18:02 -0000
Hai Paul,





You need declare <%@Language=VBSript%> Before <%response.buffer=true%>

in the code & should be as the first line in most of the .asp pages.



Raj



Raja.Ravipati - VB Programmer(UniClass) Phone : 01273 274747 Fax: 01273

274737 Web Site : www.rocc.com



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

From: Access ASP digest [mailto:access_asp@p...] 

Sent: 18 January 2002 12:00 AM

To: access_asp digest recipients

Subject: access_asp digest: January 17, 2002



-----------------------------------------------

When replying to the digest, please quote only

relevant material, and edit the subject line to

reflect the message you are replying to.

-----------------------------------------------



The URL for this list is:

http://p2p.wrox.com/list.asp?list=access_asp



ACCESS_ASP Digest for Thursday, January 17, 2002.



1. I can't upload files to my database

2. Parse ASP contained in Microsoft Access Table

3. RE: Parse ASP contained in Microsoft Access Table

4. RE: Parse ASP contained in Microsoft Access Table

5. RE: Parse ASP contained in Microsoft Access Table



----------------------------------------------------------------------



Subject: I can't upload files to my database

From: "Paul" <angelsinone@h...>

Date: Thu, 17 Jan 2002 01:48:45

X-Message-Number: 1



Hello,



I am having trouble uploading files through the web to my database. I

have 

a Filename field and a File.



User type the name of the file, then they choose the file from the Local



HDD.



In the tests, when I upload, the Filename appears but the File itself

does 

not upload. Can anyone tell me if I have the correct coding below?



<%response.buffer=true%>



<HTML>

<BODY>

	<%

 on error resume next



	Filename=request.querystring("Filename")

	 

 	

	Dim DB_CONNECTION_STRING

	DB_CONNECTION_STRING = "DRIVER={Microsoft Access Driver 

(*.mdb)};DBQ=" & Server.Mappath("designers.mdb") & ";"



	%>

		<!-- #INCLUDE FILE="adovbs.inc" -->

	<%	



	Dim objRecordset

	Set objRecordset = Server.CreateObject("ADODB.Recordset")



	objRecordset.Open "tbl_file", DB_CONNECTION_STRING,

adOpenStatic, 

adLockPessimistic, adCmdTable



	objRecordset.AddNew

	objRecordset.Fields("File") = File()

	objRecordset.Fields("Filename") = CStr(Filename)

	objRecordset.Update

	objRecordset.Close

	Set objRecordset = Nothing



	



%>



</BODY>

</HTML>



I have just added this line of code:

Set upl = Server.CreateObject("SoftArtisans.FileUp")



but I keep getting this error message:

Active Server Pages error 'ASP 0140' 



Page Command Out Of Order 



/addfile.asp, line 3 



The @ command must be the first command within the Active Server Page. 





Can Anyone help me out?

Thanks



Paul



----------------------------------------------------------------------



Subject: Parse ASP contained in Microsoft Access Table

From: "Eric Levine" <eric@d...>

Date: Thu, 17 Jan 2002 16:55:54

X-Message-Number: 2



Good morning... I am hoping someone can help me.  



I am building an application in ASP and MS-ACCESS where I have a need to

store HTML and ASP code in a Memo Field. 



When I make a call to this memo field, In MS-IE the data presents itself

properly, with the ASP getting parsed by IIS.  In Netscape however, the

ASP

delimiters are not being processed, so with the HTML code I am receiving

the non-parsed ASP code (ie. Hello there <% =rsCustomer("name") %>)

rather

than "Hello there Fred".



Does anyone know if it is possible to add HTML and ASP code to an

MS-ACCESS

DB Field (Memo, Text, etc.) and have it read by Netscape Browsers?



My reasons for doing it this way is to provide a way to edit the

HTML/ASP

through a web-based administrative interface, rather then editing the

code

directly offline.



AN EXAMPLE WOULD BE:



ACCESS DB TABLE:

Table: Config

Memo Field: Global Header

Value: <B>Hello There</B>, <% =rsCustomers("name") %>



CODE:

Response.Write rsConfig("global_header")



Thank you all in advance for your help.

----------------------------------------------------------------------



Subject: RE: Parse ASP contained in Microsoft Access Table

From: Thomas Bellavia <TBellavia@V...>

Date: Thu, 17 Jan 2002 12:05:29 -0500

X-Message-Number: 3



Maybe use URLEncode on the string first?





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

From: Eric Levine [mailto:eric@d...]

Sent: Thursday, January 17, 2002 11:56 AM

To: Access ASP

Subject: [access_asp] Parse ASP contained in Microsoft Access Table





Good morning... I am hoping someone can help me.  



I am building an application in ASP and MS-ACCESS where I have a need to

store HTML and ASP code in a Memo Field. 



When I make a call to this memo field, In MS-IE the data presents itself

properly, with the ASP getting parsed by IIS.  In Netscape however, the

ASP

delimiters are not being processed, so with the HTML code I am receiving

the non-parsed ASP code (ie. Hello there <% =rsCustomer("name") %>)

rather

than "Hello there Fred".



Does anyone know if it is possible to add HTML and ASP code to an

MS-ACCESS

DB Field (Memo, Text, etc.) and have it read by Netscape Browsers?



My reasons for doing it this way is to provide a way to edit the

HTML/ASP

through a web-based administrative interface, rather then editing the

code

directly offline.



AN EXAMPLE WOULD BE:



ACCESS DB TABLE:

Table: Config

Memo Field: Global Header

Value: <B>Hello There</B>, <% =rsCustomers("name") %>



CODE:

Response.Write rsConfig("global_header")



Thank you all in advance for your help.




$subst('Email.Unsub').



----------------------------------------------------------------------



Subject: RE: Parse ASP contained in Microsoft Access Table

From: "Eric Levine" <eric@d...>

Date: Thu, 17 Jan 2002 12:21:39 -0500

X-Message-Number: 4



Thanks for your reply.  I am afraid that did not work.



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

From: Thomas Bellavia [mailto:TBellavia@V...] 

Sent: Thursday, January 17, 2002 12:05 PM

To: Access ASP

Subject: [access_asp] RE: Parse ASP contained in Microsoft Access Table



Maybe use URLEncode on the string first?





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

From: Eric Levine [mailto:eric@d...]

Sent: Thursday, January 17, 2002 11:56 AM

To: Access ASP

Subject: [access_asp] Parse ASP contained in Microsoft Access Table





Good morning... I am hoping someone can help me.  



I am building an application in ASP and MS-ACCESS where I have a need to

store HTML and ASP code in a Memo Field. 



When I make a call to this memo field, In MS-IE the data presents itself

properly, with the ASP getting parsed by IIS.  In Netscape however, the

ASP

delimiters are not being processed, so with the HTML code I am receiving

the non-parsed ASP code (ie. Hello there <% =rsCustomer("name") %>)

rather

than "Hello there Fred".



Does anyone know if it is possible to add HTML and ASP code to an

MS-ACCESS

DB Field (Memo, Text, etc.) and have it read by Netscape Browsers?



My reasons for doing it this way is to provide a way to edit the

HTML/ASP

through a web-based administrative interface, rather then editing the

code

directly offline.



AN EXAMPLE WOULD BE:



ACCESS DB TABLE:

Table: Config

Memo Field: Global Header

Value: <B>Hello There</B>, <% =rsCustomers("name") %>



CODE:

Response.Write rsConfig("global_header")



Thank you all in advance for your help.




$subst('Email.Unsub').






$subst('Email.Unsub').









----------------------------------------------------------------------



Subject: RE: Parse ASP contained in Microsoft Access Table

From: "Scott Reed" <scottr@m...>

Date: Thu, 17 Jan 2002 12:51:29 -0600

X-Message-Number: 5



I'm not entirely sure that this CANT be done the way you're trying to do

it

but...



I believe that if you have ASP embedded within the text of your database

record, it

will be not be executed because your code is executed prior to writing

out

to the browser.



You may want to look into Stored Procedures or writing a Global Include

file

that does

the work for you. In this case, you would write a function that collects

the

UserID and

builds a Welcome Message. The result would be something like...



<!--#include virtual="includes/incGlobal.inc"-->

<!--#include virtual="includes/header.inc"-->

<%WRITE_WELCOME_MESSAGE%>

<!--#include virtual="includes/footer.inc"-->



Again, I'm not totally sure you can't get code stored in a database

record

to execute

but I was not able to. I have found that building reusable functions to

build page content

was more effective and solved the same problem. Now, all of my pages

look

like....



<!--#include virtual="includes/incGlobal.inc"--> 'contains all site

functions, database connection, etc

<!--#include virtual="includes/header.inc"-->



	<%WRITE_WELCOME_MESSAGE%>			'Gets UserID and

builds a welcome message

	<%WRITE_SEARCH%>

'Presents a search feature

	<%WRITE_THISPAGE_CONTENT%>			'can make a

function that builds each page of

website

	<%CLEAN_UP%>					'closes db conn

and sets everything to nothing



<!--#include virtual="includes/footer.inc"-->









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

From: Eric Levine [mailto:eric@d...]

Sent: Thursday, January 17, 2002 4:56 PM

To: Access ASP

Subject: [access_asp] Parse ASP contained in Microsoft Access Table





Good morning... I am hoping someone can help me.



I am building an application in ASP and MS-ACCESS where I have a need to

store HTML and ASP code in a Memo Field.



When I make a call to this memo field, In MS-IE the data presents itself

properly, with the ASP getting parsed by IIS.  In Netscape however, the

ASP

delimiters are not being processed, so with the HTML code I am receiving

the non-parsed ASP code (ie. Hello there <% =rsCustomer("name") %>)

rather

than "Hello there Fred".



Does anyone know if it is possible to add HTML and ASP code to an

MS-ACCESS

DB Field (Memo, Text, etc.) and have it read by Netscape Browsers?



My reasons for doing it this way is to provide a way to edit the

HTML/ASP

through a web-based administrative interface, rather then editing the

code

directly offline.



AN EXAMPLE WOULD BE:



ACCESS DB TABLE:

Table: Config

Memo Field: Global Header

Value: <B>Hello There</B>, <% =rsCustomers("name") %>



CODE:

Response.Write rsConfig("global_header")



Thank you all in advance for your help.




$subst('Email.Unsub').









---



END OF DIGEST






$subst('Email.Unsub').



DISCLAIMER:

This E-mail contains proprietary information some or all of which may be



legally privileged. It is for the intended recipient only. If an

addressing 

or transmission error has misdirected this E-mail, please notify the

author 

by replying to this E-mail.

If you are not the intended recipient you must not use, disclose,

distribute, copy, print, or rely on this E-mail.



DISCLAIMER:

This E-mail contains proprietary information some or all of which may be 

legally privileged. It is for the intended recipient only. If an addressing 

or transmission error has misdirected this E-mail, please notify the author 

by replying to this E-mail.

If you are not the intended recipient you must not use, disclose,

distribute, copy, print, or rely on this E-mail.




  Return to Index