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. 🚫 No AI-generated (LLM) posts allowed. 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.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom