• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

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