18. december 2004 - 13:18Der er
8 kommentarer og 1 løsning
Hvordan ændrer jeg db-connection?
Jeg har et script med en noget underlig db-connection. Kan nogen se, hvordan jeg ændrer den, så jeg kan bruge en dsn-less forbindelse lokalt på min pc. Jeg har prøvet alt muligt uden held.
Forbindelsen ser sådan ud!
Dim DB_CONNECTIONSTRING Dim objRecordset
DB_CONNECTIONSTRING = "DSN=xxxdkdsn"
Set objRecordset = Server.CreateObject("ADODB.Recordset") objRecordset.Open "calendar", DB_CONNECTIONSTRING, adOpenStatic, adLockPessimistic, adCmdTable
Kommunerne har digitaliseret indgangen for borgerne. Men bag skærmen håndteres mange arbejdsgange stadig manuelt mellem systemer, mails og organisatoriske siloer.
<% Function GetDaysInMonth(iMonth, iYear) Select Case iMonth Case 1, 3, 5, 7, 8, 10, 12 GetDaysInMonth = 31 Case 4, 6, 9, 11 GetDaysInMonth = 30 Case 2 If IsDate("February 29, " & iYear) Then GetDaysInMonth = 29 Else GetDaysInMonth = 28 End If End Select End Function
Function GetWeekdayMonthStartsOn(iMonth, iYear) GetWeekdayMonthStartsOn = WeekDay(CDate(iMonth & "/1/" & iYear)) End Function
Function SubtractOneMonth(dDate) Dim iDay, iMonth, iYear iDay = Day(dDate) iMonth = Month(dDate) iYear = Year(dDate)
If iMonth = 1 Then iMonth = 12 iYear = iYear - 1 Else iMonth = iMonth - 1 End If
If iDay > GetDaysInMonth(iMonth, iYear) Then iDay = GetDaysInMonth(iMonth, iYear)
SubtractOneMonth = CDate(iMonth & "-" & iDay & "-" & iYear) End Function
Function AddOneMonth(dDate) Dim iDay, iMonth, iYear iDay = Day(dDate) iMonth = Month(dDate) iYear = Year(dDate)
If iMonth = 12 Then iMonth = 1 iYear = iYear + 1 Else iMonth = iMonth + 1 End If
If iDay > GetDaysInMonth(iMonth, iYear) Then iDay = GetDaysInMonth(iMonth, iYear)
AddOneMonth = CDate(iMonth & "-" & iDay & "-" & iYear) End Function
Dim dDate ' Date we're displaying calendar for Dim iDIM ' Days In Month Dim iDOW ' Day Of Week that month starts on Dim iCurrent ' Variable we use to hold current day of month as we write table Dim iPosition ' Variable we use to hold current position in table
If IsDate(Request.QueryString("date")) Then dDate = CDate(Request.QueryString("date")) Else If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Then dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Else dDate = Date()
If Request.QueryString.Count <> 0 Then Response.Write "The date you picked was not a valid date. The calendar was set to today's date.<BR><BR>" End If End If End If
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.