用ACCESS和VB做学生成绩查询系统~数据库已做好~VB的代码该怎么写~(包括学号,姓名,班级查询) 跪求高手

数据库,学生表包括学号,姓名,班级;课程表包括课程号,课程名称,课程学分,开设学期,成绩表包括学号,课程号,成绩~

很简单呀! 你先启动VisualBasic6.0 然后 创立标准EXE
添加 access 数据的控件 添加的方法。 第一进入 "工程(P)" → "引用(N)" ... 打开窗口找到 Microsoft ActiveX Datam Objects 2.0 Library 选择(打对号), FORM1 添加一个Listbox控件,然后打开“查看代码” 窗口 输入下面的代码:
Public imu As Boolean
Public flag As Integer 'ìí?óoíDT??μ?±ê??
Public iflag As Integer 'êy?Y?aê?2?′ò?a±ê??
Public RS As ADODB.Recordset
Public SQL As String
Public Function TransactSQL(ByVal SQL As String) As ADODB.Recordset
Dim con As ADODB.Connection
Dim RS As ADODB.Recordset
Dim strConnection As String
Dim strArray() As String
Set con = New ADODB.Connection '′′?¨á??ó
Set RS = New ADODB.Recordset '′′?¨?????ˉ
On Error GoTo TransactSQL_Error
strConnection = "Provider=Microsoft.jet.oledb.4.0;Data Sourc e=" & "D:\Test.mdb;persist security info=false; jet oledb:database password=pnurkim32"
strArray = Split(SQL)
con.Open strConnection '′ò?aá??ó
If StrComp(UCase$(strArray(0)), "select", vbTextCompare) = 0 Then
RS.Open Trim$(SQL), con, adOpenKeyset, adLockOptimistic
Set TransactSQL = RS '·μ???????ˉ
iflag = 1
Else
con.Execute SQL '?′DD?üá?
iflag = 1
End If
TransactSQL_Exit:
Set RS = Nothing
Set con = Nothing
Exit Function
TransactSQL_Error:
MsgBox "2é?ˉ′í?ó£o" & Err.Description
iflag = 2
Resume TransactSQL_Exit
End Function

Sub Display()
SQL = "select * from Words" ‘ Words是Test数据文件的某一个表
Set RS = TransactSQL(SQL)
If RS.EOF = True Then
RS.MoveFirst
Else
While Not RS.EOF
List1.AddItem RS.Fields("English") ‘ Engilis 表示 Words表的某一个趔
RS.MoveNext
Wend
End If
RS.Close

End Sub

Private Sub Form_Load()
Display
End Sub
试试吧!来自:求助得到的回答
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-01-04
这个估计你的出钱了.这么问难道有人凭空帮你写个软件?用户需求也没写清楚呀.

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网