Jeg får følgende fejl når jeg "kører" min global.asa fil:
Application object error ''ASP 0197 : 80004005'' Disallowed object use /Ssayil12/global.asa, line 9 Cannot add object with apartment model behavior to the application intrinsic object.
og hvad står der så i line 9? Set Application("DB") = Server.CreateObject("ADODB.Connection")
Problemt er at det virker på PWS men ikke MicroSoft Informationsserver som det gerne skulle kører på snart!!
Set strConn = Server.CreateObject("ADODB.Connection") Application.Lock Application("DB") = strConn Application.UnLock
Synes godt om
Slettet bruger
07. juni 1999 - 14:51#2
ny ser det sådan ud: Application.Lock Application("sConn") = "FILEDSN=" & "d:\home\ssayil1\pizza.dsn" Set strConn = Server.CreateObject("ADODB.Connection") Application("DB") = strConn Application("DB").Open Application("sConn")* Application.UnLock og fejlen er Microsoft VBScript runtime error '800a01a8'
Object required: 'Application(...)'
/Ssayil12/global.asa, line 13 linie 13 er den med *
Set Application("RS") = Server.CreateObject("ADODB.RecordSet") Set Application("RS") = Application("DB").Execute("SELECT MAX(kundeid.ordreid) AS maxordreID FROM kundeid")* Application("ordreid") = Application("RS").Fields("maxordreID")
set Application("RS") = Application("DB").Execute("SELECT MAX(kundeid.kundeid) AS maxkundeID FROM kundeid") Application("kundeid") = Application("RS").Fields("maxkundeID")
set Application("RS") = Application("DB").Execute("SELECT MAX(pizzaid) AS maxpizzaID FROM pizza") Application("antalpizza") = Application("RS").Fields("maxpizzaID")
End Sub fejlen er Microsoft VBScript runtime error '800a01a8'
Man plejer ikke at åbne databaser i global.asa, og holde dem åbne ved at putte dem i Application("...").
Hvis det ikke er meningen, de skal holdes åbne, men du blot skal aflæse nogle værdier, som skal puttes i Application("..."), skal du blot bruge almindelige variabler til connection og recordset etc.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.