Public UserName As String
Sub Main()
Dim fLogin As New frmLogin
fLogin.Show vbModal
If Not fLogin.OK Then
'Login Failed so exit app
End
End If
Unload fLogin
Set fMainForm = New frmMain
fMainForm.Show
End Sub
.........................................................................................................
Public Function ConnectString() _
As String
'returns a DB ConnectString
ConnectString = "FileDSN=studentinfo.dsn;UID=sa;PWD="
End Function
.......................................... SQL语句执行程序 ..............................................
Public Function ExecuteSQL(ByVal SQL _
As String, MsgString As String) _
As ADODB.Recordset
'executes SQL and returns Recordset
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim sTokens() As String
On Error GoTo ExecuteSQL_Error
sTokens = Split(SQL)
Set cnn = New ADODB.Connection
cnn.Open ConnectString
If InStr("INSERT,DELETE,UPDATE", _
UCase$(sTokens(0))) Then
cnn.Execute SQL
MsgString = sTokens(0) & _
<< 上一页 [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] ... 下一页 >>