Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. Share your own thoughts and experience, accounts may be terminated for violations.

ASP Global.asa

Status
Not open for further replies.
Joined
Jul 8, 2004
Posts
2,605
Reaction score
25
I have this in the global.asa

Code:
sub getDeft
	'----------------DatabaseConnection----
	Dim conn_personal
	Dim Conn
	
	Set Conn = Server.CreateObject("ADODB.Connection")
	conn_personal ="DRIVER={Microsoft Access Driver (*.mdb)};"
	conn_personal = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\inetpub\wwwroot\db\template.mdb"

	Conn.Open conn_personal
	'--------------------------------------

	Dim rsDefault
	Dim rsDefault_numRows
	
	Set rsDefault = Server.CreateObject("ADODB.Recordset")
	rsDefault.ActiveConnection = conn_personal
	rsDefault.Source = "SELECT * from default" 
	rsDefault.CursorType = 0
	rsDefault.CursorLocation = 2
	rsDefault.LockType = 1
	rsDefault.Open()
	
	rsDefault_numRows = 0

	vDefault = rsDefault.GetRows ' convert RS to array! 
	rsDefault_numRows = 0
	set rsDefault = nothing
	
	Application("DEFT") = vDefault
	
End sub


i'm trying to reference it in a asp page:
Code:
vDeft = Application("DEFT")

response.Write(vDeft(1))
response.End()

but i get the response
Code:
Microsoft VBScript runtime error '800a0009' 

Subscript out of range: 'vDeft' 

/results.asp, line 35

this would kinda of indicate that the select is failing in the asa but nothing shows? am i referencing the array correctly?

thanks
:doom
 
Status
Not open for further replies.
Top Bottom