代码如下:
Public Function Executeqx(ByVal txt As Integer) As String '定义Executeqx函数,txt为变量,返回字符数值
Dim sql As String
Dim mycon As ADODB.Connection
Dim rst As ADODB.Recordset
Set mycon = New ADODB.Connection
mycon.ConnectionString = connstring
mycon.Open
Set rst = New ADODB.Recordset
sql = "select admin from use where username='" & username & "'"
rst.Open Trim(sql), mycon, adOpenKeyset, adLockOptimistic
临摹微笑
相关分类