Hello, I created a simple waiting list database for a child care centre using ASP and SQL Server. The code was automatically generated through Dreamweaver. Everything works fine on my machine. It also works fine when I use my Citrix account. However, everyone else on Citrix get an error becasue they enter the date in Australian DD/MM/YYYY format. I enter the data in this format on my machine and the database updates without problems. I response.writed the SQL statement and it looks fine. The weird thing is that when I cope the SQL and run it directly on the SQL server I get the date error. The regional setting are all set to Australia on all servers, PC and Citrix accounts. I'm totally baffled. Does anyone know how to fix this problem or what is causing it? I tried setting the LCID to 3081 but that didn't work. With regards to amending the code, it was generated in dreamweaver and looks pretty strange (!). I'm not an expert programmer so I'm not sure how to hack the code. Please could you look at the code I'm using and point me in the right direction?
Cheers.
Dave
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")
) = "form1" And CStr(Request("MM_recordId"
)) <> "") Then
MM_editConnection = MM_conDF_DEV_STRING
MM_editTable = "dbo.tblWaitingLists"
MM_editColumn = "ID"
MM_recordId = "" + Request.Form("MM_recordId"
) + ""
MM_editRedirectUrl = "child-details.asp"
MM_fieldsStr = "frmListName|value|frmPare
ntName|val
ue|frmPhon
eNumber|va
lue|frmMob
ileNumber|
value|frmE
mail|value
|frmHouseN
umberStree
t|value|fr
mSuburb|va
lue|frmCit
y|value|fr
mPostcode|
value|frmH
owHeard|va
lue|frmChi
ldName|val
ue|frmChil
dAge|value
|frmChildD
OB|value|f
rmHoursOpt
ion|value|
frmNotes|v
alue|frmFa
milyName|v
alue|textf
ield|value
|textfield
2|value|fr
mDateReque
sted|value
|frmPriori
ty|value|f
rmStatus|v
alue"
MM_columnsStr = "ListName|',none,''|Parent
Name|',non
e,''|Phone
|',none,''
|Mobile|',
none,''|Em
ail|',none
,''|HouseN
umberStree
t|',none,'
'|Suburb|'
,none,''|C
ity|',none
,''|Postco
de|none,no
ne,NULL|Ho
wHeard|',n
one,''|Chi
ldName|',n
one,''|Chi
ldAge|none
,none,NULL
|ChildDOB|
',none,NUL
L|HoursOpt
ion|',none
,''|Notes|
',none,''|
FamilyName
|',none,''
|CareDays|
',none,''|
MonthOfCom
mencement|
',none,''|
DateReques
ted|',none
,NULL|Prio
rity|none,
none,NULL|
Status|non
e,none,NUL
L"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_field
s(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")
) <> "" And CStr(Request("MM_recordId"
)) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),"
,")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''
") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB
.Command")
MM_editCmd.ActiveConnectio
n = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnectio
n.Close
session("query")= MM_editQuery
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editR
edirectUrl
)
End If
End If
End If
%>
<%
Dim rsWaitingList__MMColParam
rsWaitingList__MMColParam = "1"
If (Request.QueryString("ID")
<> "") Then
rsWaitingList__MMColParam = Request.QueryString("ID")
End If
%>
Start Free Trial