Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

ASP Global.asa

Status
Not open for further replies.
Joined
Jul 8, 2004
Posts
2,604
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
 
Code:
response.write(ubound(vDeft))
this results in

45

so i must be referencing the array wrong?
 
perhaps if anyone could suggest a good ASP development forum - experience required I can use google :D
 
i have a tendance to quit early - i've now stared at it for 10 mins and sorted it

referencing the array wrong - as i first suspected
 
Status
Not open for further replies.

The Rule #1

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

Premium Members

Latest Comments

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.
      There are no messages in the current room.
      Top Bottom