<% '------------------------------------------------------------------------------ Function SQLPrep_s(ByVal StringValue, ByRef MaxLength) If MaxLength > 0 Then StringValue = Left(StringValue, MaxLength) End If StringValue = Replace(StringValue, "'", "''") If StringValue = "" Then SQLPrep_s = "NULL" Else SQLPrep_s = "'" & StringValue & "'" End If End Function '------------------------------------------------------------------------------ Function SQLPrep_n(ByVal NumericValue) If IsNumeric(NumericValue) And NumericValue <> "" Then SQLPrep_n = NumericValue Else SQLPrep_n = "NULL" End If End Function '------------------------------------------------------------------------------ Function SQLPrep_b(ByVal BooleanValue, ByRef DefaultValue) Const DB_TRUE = 1 '1 = SQL, -1 = Access Const DB_FALSE = 0 Dim lbResults On Error Resume Next If BooleanValue = "" Then BooleanValue = DefaultValue lbResults = Cbool(BooleanValue) If Err Then Err.Clear lbResults = DefaultValue End If If lbResults Then SQLPrep_b = DB_TRUE Else SQLPrep_b = DB_FALSE End If End Function '------------------------------------------------------------------------------ Function SQLPrep_d(ByVal DateValue) If IsDate(DateValue) Then SQLPrep_d = "'" & DateValue & "'" Else SQLPrep_d = "NULL" End If End Function '------------------------------------------------------------------------------ Function SQLPrep_c(ByVal CurrencyValue) On Error Resume Next If CurrencyValue = "" Then CurrencyValue = "NULL" Else CurrencyValue = CCur(CurrencyValue) If Err Then Err.Clear CurrencyValue = "NULL" End If End If SQLPrep_c = CurrencyValue End Function '------------------------------------------------------------------------------ %>