Dim ConnObj Set ConnObj = Server.Createobject("ADODB.Connection") Set RstObj = Server.CreateObject("ADODB.Recordset") strDSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=d:\udvikling\data\database.mdb; password=123abc" ConnObj.Open strDSN
fundet = False Set RstObj = ConnObj.openschema(20) Do until RstObj.eof If RstObj("TABLE_TYPE") = "TABLE" Then if RstObj("TABLE_NAME") = strTABEL then fundet = true exit do end if End if RstObj.movenext Loop
Scriptet skal tjekke om en tabel med dags dato findes - hvis den gør skal den ikke foretage sig andet end skrive fundet - hvis ikke skal den oprette tabellen med navn som dags dato.
Dim ConnObj Set ConnObj = Server.Createobject("ADODB.Connection") Set RstObj = Server.CreateObject("ADODB.Recordset") strDSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=d:\udvikling\data\database.mdb; password=123abc" ConnObj.Open strDSN
fundet = False Set RstObj = ConnObj.openschema(20) Do until RstObj.eof If RstObj("TABLE_TYPE") = "TABLE" Then if RstObj("TABLE_NAME") = strTABEL then fundet = true exit do end if End if RstObj.movenext Loop
SQL = "CREATE INDEX [CountIndex] ON [" & strTABEL & "] ([Count])" ConnObj.Execute(SQL)
end if %>
Synes godt om
Ny brugerNybegynder
Din løsning...
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.