- Joined
- Jul 8, 2004
- Posts
- 2,604
- Reaction score
- 25
I have this in the global.asa
i'm trying to reference it in a asp page:
but i get the response
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:
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