27. februar 2007 - 11:44
#2
Vi programmerer ASP
Error while executing the query; ERROR: date/time field value out of range: "27-02-2007" HINT: Perhaps you need a different "datestyle" setting.
/get_subject.asp, line 92
linie 92 er første linie her:
Set recall_combo = myConn.Execute(SQL_NULLTIME_COMBO)
Dim log_recall_date
Dim log_recall_time
Dim log_recall_id
If Not recall_combo.EOF Then
id = recall_combo("id")
log_recall_date = recall_combo("recall")
log_recall_time = recall_combo("recall_time")
log_recall_id = recall_combo("id")
isRecall = id
myBooleanRecall = True
tmpHour = ""
If Not IsNull(recall_combo("recall_time")) Then
tmpHour = "+" & FormatDateTime(recall_combo("recall_time"), 4)
End If
Response.Write( "isrecall="& recall_combo("recall") & tmpHour & "&")
Else
'// Er allerede sat, men jeg fremhæver det.
myBooleanRecall = False
End If
recall_combo.Close
Set recall_combo = Nothing
If myBooleanRecall Then
Call logRecall(log_recall_id, log_recall_date, log_recall_time)
End If
28. februar 2007 - 00:08
#3
Håber nogle kan hjælpe med disse her ODBC driver errors!
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
ODBC driver does not support the requested properties.
/get_calendar.asp, line 84 (som er: myRS.Open)
Set myCampaignsDict = Server.CreateObject("SCRIPTING.Dictionary")
set mySubjectCampaigns = myConn.Execute("SELECT id FROM campaign WHERE client_id=" & myClient_id & " GROUP BY id")
if not mySubjectCampaigns.eof then
do until mySubjectCampaigns.eof
myCampaignsDict.add cstr(mySubjectCampaigns("id")),cstr(mySubjectCampaigns("id"))
mySubjectCampaigns.movenext
loop
myCampaigns = myCampaignsDict.Keys
end if
'Response.Write( "eof=" & mySubjectCampaigns.eof & "&" )
SQL = "SELECT id, date, time, seller_name, company_name, company_postal as postal, company_city as city FROM get_meeting WHERE date>(current_date - integer '1') AND campaign_id IN ("&Join(myCampaigns, ",") & ")"
if Request("seller_id")<> "0" AND Request("seller_id")<> "undefined" then
SQL = SQL & " AND seller_id = " & Request("seller_id")
else
'Hent kun de aktuelle sælgere i denne kampagne
testSQL = "SELECT seller.Id FROM (seller INNER JOIN seller_campaign ON seller.id=seller_campaign.seller_id) WHERE seller_campaign.campaign_id=" & id
Set getSellers = myConn.Execute(testSQL)
'Response.Write( testSQL )
if NOT getSellers.eof then
myTemp = ""
do until getSellers.eof
myTemp = myTemp & getSellers("Id")
getSellers.moveNext
If NOT getSellers.eof then myTemp = myTemp & ","
loop
SQL = SQL & " AND seller_id IN (" & myTemp & ")"
end if
end if
if Request("date")<> "" then
'SQL = SQL & " AND seller_id = " & Request("seller_id")
if Cdate(Request("date")) then
myDate = Cdate(Request("date"))
else
myDate = Now()
end if
else
myDate = Now()
end if
'firstDayInMonth = DateSerial(year(myDate), month(myDate), 1)
'lastDayInMonth = DateSerial(year(myDate), month(myDate), 1)
'lastDayInMonth = DateAdd("m", 1, lastDayInMonth)
'lastDayInMonth = DateAdd("d", -1, lastDayInMonth)
'SQL = SQL & " AND (([date] >= #" & firstDayInMonth & "#) AND ([date] <= #" & lastDayInMonth & "#))"
myYear = year(myDate)
myMonth = month(myDate)
SQL = SQL & " AND ( EXTRACT(YEAR FROM date)="&myYear&" AND EXTRACT(MONTH FROM date)="&myMonth&")"
SQL = SQL & " order by date,time"
'Response.Write(sql & "&")
myRS.Source = sql
myRS.CursorType = 1
myRS.CursorLocation = 2
myRS.LockType = 2
myRS.Open
Response.Write( "recordCount=" & myRS.recordCount & "&" )