Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/01/2006, 00:28
freemojorisin
 
Fecha de Ingreso: mayo-2005
Mensajes: 27
Antigüedad: 19 años
Puntos: 0
Problema con Objeto Session

Hola.

Tengo un problemilla al cargar un sitio. En el global.asa tengo este codigo.

Código:
SUB Application_OnStart
	Application("strBookId")= 2
END SUB


Sub Session_OnStart
	'Response.CacheControl="private"
	'Response.Expires=0
	'on error resume next
	dim con
	dim cmdLinks, cmdExample
	dim rsLinks, rsExample
	dim arrExample
	dim arrHeadword(0,0)
	dim paramBookId
	dim str
	
	set con = server.CreateObject("ADODB.Connection")
	'con.Open "DSN=DKEEXP;UID=un_usr;PWD=un_pass"
	'con.Open "DSN=ED;UID=sa;PWD=sa"
	set cmdLinks = server.CreateObject("ADODB.Command")
	set rsLinks = server.CreateObject("ADODB.Recordset")
	
	Dim serverNAME, alosada_STRING, DatabaseName, DbUsername, DbPassword
	serverNAME = "blablabla.brinkster.com"
	DatabaseName = "!!!!!!"
	DbUsername = "!!!!!!"
	DbPassword = "********"

	alosada_STRING = "Provider=SQLOLEDB;Data Source='" & serverNAME & "';Initial Catalog=" & Database_Name & ";User Id=" & DbUsername & ";Password=" & DbPassword & ";"
	
	con.Open(alosada_STRING)
			
	cmdLinks.ActiveConnection = con
	cmdLinks.CommandType =4
	cmdLinks.CommandText = "sp_getGooglePictureLinks"
	set paramBookId = cmdLinks.CreateParameter("bookid",3,,,Application("strBookId"))
	cmdLinks.Parameters.append paramBookId
	set rsLinks = cmdLinks.Execute()
			
	sectionDict.Add "sec2Title","dinosaurios"
	sectionDict.Add "sec2ImgPrefix","gifs/dinosaurs/exdino"
	sectionDict.Add "sec2SpanClass","dinolink"
	sectionDict.Add "sec2SpanClassHome","dinolink"
	sectionDict.Add "sec2NoResultClass","noresultsdino"
	sectionDict.Add "sec2GoogleImg","gifs/dino/exdino_googledirectory.gif"
	sectionDict.Add "sec2GoogleLink", cstr(rsLinks("GoogleLink"))
	sectionDict.Add "sec2PicLink", cstr(rsLinks("ClipartLink"))
	sectionDict.Add "sec2body","bodydinored"
	sectionDict.Add "sec2css", "styles/styles_dino.css"
	sectionDict.Add "sec2bgcolor", "#F5D6D6"
	sectionDict.Add "sec2listcolor", "#CC3333"
			
	arrHeadword(0,0)=""
	set cmdExample = server.CreateObject("ADODB.Command")
	set rsExample = server.CreateObject("ADODB.Recordset")
	cmdExample.ActiveConnection = con
	cmdExample.CommandType = 4
	cmdExample.CommandText = "sp_getexampleheadwords"
	set rsExample = cmdExample.Execute()
	
	If not rsExample.BOF=true and rsExample.EOF=true then
		arrExample = rsExample.GetRows()
		Session("arrExample") = arrExample
	End If
	
	Session("arrHeadword")=arrHeadword
	set Session("sectionDict") = sectionDict
	
	set Session("con") = con
	Session("strSectionId")=2
	set rsLinks = nothing
	set rsExample = nothing
	set cmdExample = nothing
	set cmdLinks = nothing	
End sub

Sub Session_OnEnd 
	set con = nothing
End Sub
y en la pagina variables.asp de la carpeta includes tengo este codigo

Código:
secID = "sec" & Application("strBookId")
	set secDict = Session("sectionDict")
	strTitle = secDict.Item(secID & "Title")
	strImgPrefix = secDict.Item(secID & "ImgPrefix")
	strSpanClass = secDict.Item(secID & "SpanClass")
	strSpanClassHome = secDict.Item(secID & "SpanClassHome")	
	strCss = secDict.Item(secID & "css")
	strbgcolor = secDict.Item(secID & "bgcolor")
	strImgArrow = secDict.Item(secID & "arrow")
	strGoogleLink = secDict.Item(secID & "GoogleLink")
	strGoogleImg = secDict.Item(secID & "GoogleImg")
	strPicLink = secDict.Item(secID & "PicLink")
	strNoResultClass = secDict.Item(secID & "NoResultClass")
	strBodyClass = secDict.Item(secID & "body")
	strListColor = secDict.Item(secID & "listcolor")
Al cargar la pagina de inicio del site me sale este error.

Microsoft VBScript runtime error '800a01a8'

Object required: 'Session(...)'

/projects/ED/includes/variables.asp, line 3

La verdad no se que puede ser.

Gracias por su colaboracion

Última edición por AlZuwaga; 12/02/2006 a las 13:03