漢字轉注音、漢字轉拼音 vbscript

                  Function 漢字轉注音(x As String)
Dim rst As New ADODB.Recordset, cnt As New ADODB.Connection
cnt.Open "Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=E:\@@@華語文工具及資料@@@\Macros\chinesewords.mdb"
rst.Open "select 字,注音 from words where strcomp(字,""" & x & """)=0", cnt, adOpenKeyset
If rst.RecordCount > 0 Then
    漢字轉注音 = rst.Fields("注音").Value
Else
    漢字轉注音 = Null
End If
rst.Close: cnt.Close
End Function


Function 漢字轉拼音(x As String)
Dim rst As New ADODB.Recordset, cnt As New ADODB.Connection
cnt.Open "Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=E:\@@@華語文工具及資料@@@\Macros\chinesewordsVBA.mdb"
rst.Open "select F2,F3 from superpy where strcomp(F2,""" & x & """)=0", cnt, adOpenKeyset
If rst.RecordCount > 0 Then
    If rst.RecordCount > 1 Then
        Do Until InStr(rst.Fields("F3").Value, "◆") > 0
            rst.MoveNext
            If rst.EOF Then
                rst.MoveFirst
                Exit Do
            End If
        Loop
        漢字轉拼音 = rst.Fields("F3").Value
    Else
        漢字轉拼音 = rst.Fields("F3").Value
    End If
Else
    漢字轉拼音 = Null
End If
rst.Close: cnt.Close
End Function