p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: ASP 3.0


Message #1 by "Phil Perks" <philp@w...> on Fri, 23 Jun 2000 14:59:56
-----Original Message-----
From: Naga Média [mailto:naga_media@h...]
Sent: 22 June 2000 19:45
To: support@w...
Subject: ASP 3.0 ISBN=1-861003-23-4 53499


Hi !
My name is Clément Tremblay from Naga Média.

I have difficulty to communicate Object beetween Global.asa
and Guestbook.asp and GuestBook.dll component.

I work on windows98 with PWS, and Visual Basic 6.0 and Access database.
My questions are inside the code follow: Like /****1.Question?****/

Thanks
Clément Tremblay eng.
Naga Média


My global.asa:
-----------------------------------------
Sub Session_OnStart()
Dim MyGuestbook
Dim MyNGB
set Session("MyGuestbook")=Server.CreateObject("Guestbook.GuestbookData")
MyNGB=Session("MyGuestbook")
Server.Execute "./GuestBook/Guestbook.asp"
Response.Write "OBJECT GUEST BOOK CREATED wwwroot Global"
End Sub
-----------------------------------------

My Guestbook.asp:
/******** 1.IS THAT CORRECT ? ******/
-----------------------------------------
<%
'Dim MyNGB
Dim MySet_Field
'MyNGB=Session("MyGuestbook")
MyNGB.Set_Language("Spanish")
MySet_Field=MyNGB.Set_Field("#ff00ff","#ffffff")

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="NetObjects Fusion 4.0.1 for Windows">
<TITLE>Guest Book</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080"  TOPMARGIN=0 
LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 
BACKGROUND="./Images/space2.gif">

/************** 2.WHAT I NEED HERE TO RETREIVE SESION OBJECT ? ******/
<%
Response.Write MyNGB.GetEntries
%>

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

My GusetbookData.cls:
/*********3. DO I NEED TO PASS A VALUE TO GetEntries() TO RETREIVE SESSION
OBJECT ? ****/
---------------------------------------------------
Public Function GetEntries()

Dim Conn As New ADODB.Connection
Dim RSEntries As ADODB.Recordset
Dim TheDate As String
Dim TheName As String
Dim TheEmail As String
Dim TheCity As String
Dim TheCountry As String
Dim TheLanguage As String
Dim TheComment As String
Dim Print_Tampon As String
Print_Tampon = ""

Conn.Open "ASPComp", "sa", ""
Set RSEntries = Conn.Execute("select Dates, Name, EMail, City, Country, 
Language, Comment " _
    & "From C5Guestbook where Country = 'CA' and Language = 'FR'")
Do Until RSEntries.EOF
TheDate = RSEntries("Dates")
TheName = RSEntries("Name")
TheEmail = RSEntries("EMail")
TheCity = RSEntries("City")
TheCountry = RSEntries("Country")
TheLanguage = RSEntries("Language")
TheComment = RSEntries("Comment")
MsgBox ("GetEntries 1 IF Q_ON " & Query_ON)
    MsgBox ("GetEntries Q_ON Good Record " & Query_ON)
        GetEntries = GetEntries & Print_Record(TheDate, TheName, TheEmail,
TheCity, TheCountry, TheLanguage, TheComment)
        RSEntries.MoveNext
     ...
________________________________________________________________________

  Return to Index