7,763
社区成员
发帖
与我相关
我的任务
分享
Public Function hzz()
Dim K As Integer
Dim l As Integer
l = Len(PYH(j))
For K = 1 To l
hz1(K) = Mid(PYH(j), K, 1)
If hz1(K) = "A" Or hz1(K) = "I" Or hz1(K) = "E" Or hz1(K) = "V" Or hz1(K) = "U" Or hz1(K) = "O" Then
hz1(K) = Mid(PYH(j), 1, K - 1)
'Print hz1(K); K
Exit For
End If
Next
py1(j) = hz1(K)
End Function
Option Explicit
Dim i As Integer
Dim sj() As String
Dim l As Integer
Dim j As Integer
'Dim K As Integer
Dim hz(7) As String * 1
Dim py1(7) As String * 1
Dim hz1(7) As String
Dim PY As String
Dim PYH(7) As String
Dim PYHSTR As String
Private Sub Form_Load()
Text1 = ""
Text2 = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
For j = 1 To Len(Text1)
hz(j) = Mid(Text1, j, 1)
'Print hz(j)
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db8.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from winpy where 汉字 like '" & hz(j) & "%'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
l = Len(Adodc1.Recordset(0))
ReDim sj(l)
For i = 1 To l
sj(i) = Mid(Adodc1.Recordset(0), i, 1)
If Asc(sj(i)) > 0 Then
PY = UCase(Mid(Adodc1.Recordset(0), i, l - i + 1))
Exit For
End If
Next
End If
'Print PY
PYH(j) = PY
Next j
For j = 1 To Len(Text1)
hzz
PYHSTR = PYHSTR + py1(j)
Next
'Print PYHSTR
Text3 = PYHSTR
KeyAscii = 0
End If
End Sub
Public Function hzz()
Dim K As Integer
Dim l As Integer
l = Len(PYH(j))
For K = 1 To l
hz1(K) = Mid(PYH(j), K, 1)
If hz1(K) = "A" Or hz1(K) = "I" Or hz1(K) = "E" Or hz1(K) = "U" Or hz1(K) = "O" Then
hz1(K) = Mid(PYH(j), 1, K - 1)
'Print hz1(K); K
Exit For
End If
Next
py1(j) = hz1(K)
End Function