毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

VB+SQL server学生信息管理系统毕业论文附源代码 第13页

更新时间:2007-10-13:  来源:毕业论文

 

Public fMainForm As frmMain

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) & _

" query successful"

Else

Set rst = New ADODB.Recordset

rst.Open Trim$(SQL), cnn, _

adOpenKeyset, _

adLockOptimistic

'rst.MoveLast 'get RecordCount

Set ExecuteSQL = rst

MsgString = "查询到" & rst.RecordCount & _

" 条记录 "

End If

ExecuteSQL_Exit:

Set rst = Nothing

Set cnn = Nothing

Exit Function

 

ExecuteSQL_Error:

MsgString = "查询错误: " & _

Err.Description

Resume ExecuteSQL_Exit

End Function

 

.........................................................................................................

 

Public Function Testtxt(txt As String) As Boolean

If Trim(txt) = "" Then

Testtxt = False

Else

Testtxt = True

End If

End Function

 

 

.................................. frmlogin窗口 ...........................................

 

Option Explicit

Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long

 

 

Public OK As Boolean

'记录确定次数

Dim miCount As Integer

Private Sub Form_Load()

Dim sBuffer As String

Dim lSize As Long

 

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]  ... 下一页  >> 

VB+SQL server学生信息管理系统毕业论文附源代码 第13页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。