我想SQL应该没有这功能吧.需要另外写函数
在别的地方看到这样一段代码,没有测试.
Function GetSQLString(ByVal Index)
Dim
Ascii(27)
Dim Line,Row,Char,strTemp
Dim i,j
Ascii(1) = "45217,45252"
Ascii(2) = "45253,45310;45485,45566;45731,45760"
Ascii(3) = "45761,45822;45985,46078;46241,46317"
Ascii(4) = "46318,46334;46497,46590;46753,46825"
Ascii(5) = "46826,46846;47009,47009"
Ascii(6) = "47010,47102;47265,47296"
Ascii(7) = "47297,47358;47521,47613"
Ascii(8) = "47614,47614;47777,47870;48033,48118"
Ascii(9) = ""
Ascii(10) = "48119,48126;48289,48382;48545,48638;48801,48894;49057,49061"
Ascii(11) = "49062,49150;49313,49323"
Ascii(12) = "49324,49406;49569,49662;49825,49895"
Ascii(13) = "49896,49918;50081,50174;50337,50370"
Ascii(14) = "50371,50430;50593,50613"
Ascii(15) = "50614,50621"
Ascii(16) = "50622,50686;50849,50905"
Ascii(17) = "50906,50942;51105,51198;51361,51386"
Ascii(18) = "51387,51445"
Ascii(19) = "51446,51454;51617,51710;51873,51966;52129,52217"
Ascii(20) = "52218,52222;52385,52478;52641,52697"
Ascii(21) = ""
Ascii(22) = ""
Ascii(23) = "52698,52734;52897,52979"
Ascii(24) = "52980,52990;53153,53246;53665,53688"
Ascii(25) = "53689,53758;53921,54014;54177,54270;54433,54480"
Ascii(26) = "54481,54526;54689,54782;54945,55038;55201,55289"
If Index = "@" Then
GetSQLString = "SELECT * FROM Article WHERE SUBSTRING(REPLACE(REPLACE(Title,'“',''),'《',''),1,1) IN ('0','1','2','3','4','5','6','7','8','9') ORDER BY Title"
Exit Function
End If
GetSQLString = "SELECT * FROM Article WHERE SUBSTRING(REPLACE(REPLACE(Title,'“',''),'《',''),1,1) IN (" & "'" & Index & "'"strTemp = Ascii(Asc(UCase(Index)) - 64)
If strTemp <> "" Then
Line = Split(strTemp, ";")
For i = 0 To UBound(Line)
Row = Split(Line(i), ",")
For j = Row(0) To Row(1)
Char = Chr(j - 65536)
GetSQLString = GetSQLString & ",'" & Char & "'"
Next
Next
End If
GetSQLString = GetSQLString & ") ORDER BY Title"
End Function
Dim Connection,Recordset
Set Connection = Server.CreateObject("ADODB.Connection")
Set Recordset = Server.CreateObject("ADODB.Recordset")
Connection.Open "......"
Recordset.Open GetSQLString("a"),Connection... ...