关于“vb学生信息管理系统”的问题

niyingchao 2008-06-04 12:12:00
程序是我下的,现在发现几个问题,希望有人帮我解答下。不过我可用分少只有70分...谢谢(老师都帮不了我)
问题一:access的问题,我昨天上网一直查,说是要压缩数据库,我怎么也没弄明白。。。(不要鄙视我)
问题二:学生交费管理中的,学生交费查询,开始不显示,后来我好不容易把它改了,还是有问题,不能用。。。
问题三:成绩管理中的成绩查询根本就没,成绩浏览也不好使。。。查询没有就没有吧。可是那个浏览......
谁来帮我解答一下吧.............我都疯很久了.........帮帮我吧........
邮箱:niyingchao130@163.com我把程序给大家看看,能改的话帮帮我吧...............
十分感谢
...全文
1943 21 打赏 收藏 转发到动态 举报
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
w121480333 2010-12-03
  • 打赏
  • 举报
回复
sdddddddddddddddddddddddddddddddddd
w121480333 2010-12-03
  • 打赏
  • 举报
回复
sdddddddddddddddddddddddddddddddd
tttyyy_t 2010-06-01
  • 打赏
  • 举报
回复
好难做 郁闷啊
loveking1234 2009-04-19
  • 打赏
  • 举报
回复

Tiger_Zhao 2008-06-05
  • 打赏
  • 举报
回复
http://community.csdn.net/IndexPage/SmartQuestion.aspx
niyingchao 2008-06-05
  • 打赏
  • 举报
回复
没人看了,算了,......分不加了,直接给分吧。。。。。郁闷啊.......
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
谁来帮助我啊。。。。。。明天我把分权加上
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
我弄错了啊。问题点数该是70.不知道怎么改啊?
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 Adai011 的回复:]
怎么我打开使用冒一点问题。
[/Quote]???????????????
Adai011 2008-06-04
  • 打赏
  • 举报
回复
怎么我打开使用冒一点问题。
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
我点学生交费查询,学生交费查询和学生缴费浏览一起出来。最开始的时候没反应,我加了一段show的代码,后来点查询,浏览就出来了,查询在主窗体的后面,然后主窗体怎么也关不了,除非把缴费浏览点出来关了,后来我又加了一个1,结果两个还是一起出来,不过交费查询在前面,但是什么功能也显示不了
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 vansoft 的回复:]
估计楼主是拿别人的代码改改。
[/Quote]
是啊,我是下载的啊
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
Public modi As Boolean
Public classmodi As Boolean
Public xuefeimodi As Boolean
Public txtsql As String
Public find As Boolean
Public classfind As Boolean
Public xuefeifind As Boolean
Public username As String
Public qxstr As String


Public Function ExecuteSQL(ByVal sql As String) As ADODB.Recordset
Dim mycon As ADODB.Connection
Dim rst As ADODB.Recordset
Set mycon = New ADODB.Connection
mycon.ConnectionString = connstring
mycon.Open
Dim stokens() As String
On Error GoTo exectuesql_error
stokens = Split(sql)
If InStr("INSER,DELETE,UPDATE", UCase(stokens(0))) Then
mycon.Execute sql
Else
Set rst = New ADODB.Recordset
rst.Open Trim(sql), mycon, adOpenKeyset, adLockOptimistic
Set ExecuteSQL = rst
End If
exectuesql_exit:
Set rst = Nothing
Set mycon = Nothing
Exit Function
exectuesql_error:
Resume exectuesql_exit
End Function


Public Function connstring() As String
connstring = "provider=Microsoft.Jet.OLEDB.4.0;Data source =" & App.Path & "/xs.mdb"

End Function

Public Function Executeqx(ByVal txt As Integer) As String
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
If rst.EOF = True Then
MsgBox "非法用户!", vbExclamation + vbOKOnly, "警告"
Executeqx = "nothing"
Exit Function
End If
If rst.Fields(0) = "y" Then
Executeqx = "admin"
Exit Function
End If
rst.Close
sql = "select readonly from use where username='" & username & "'"
rst.Open Trim(sql), mycon, adOpenKeyset, adLockOptimistic
If rst.Fields(0) = "y" Then
Executeqx = "readonly"
Exit Function
End If
Select Case txt
Case 1
sql = "select qx1 from use where username='" & username & "'"
Case 2
sql = "select qx2 from use where username='" & username & "'"
Case 3
sql = "select qx3 from use where username='" & username & "'"
Case 4
sql = "select qx4 from use where username='" & username & "'"
End Select
On Error GoTo exectuesql_error

Set rst = New ADODB.Recordset
rst.Open Trim(sql), mycon, adOpenKeyset, adLockOptimistic
If rst.Fields(0) = "y" Then
Executeqx = "true"
Else
Executeqx = "false"
End If
exectuesql_exit:
Set rst = Nothing
Set mycon = Nothing
Exit Function
exectuesql_error:
Resume exectuesql_exit


End Function


这个是模块代码。加到这里?
Tiger_Zhao 2008-06-04
  • 打赏
  • 举报
回复
压缩数据库:用 Access 打开 mdb,菜单“工具\数据库实用工具\压缩和修复数据库”
这是 Office 2000 下的菜单,记得 Office 97 下修复和压缩是分开的两个菜单项。
ameyume 2008-06-04
  • 打赏
  • 举报
回复
我看了一下链接数据库的代码,没有问题。
但我这里是日文环境,不支持代码里的中文。运行后界面也全是乱码。
你把遇到的问题再清楚的说一遍,这样大家也能帮你看看问题出在哪里。
你也可以把报错的内容贴图出来。
vansoft 2008-06-04
  • 打赏
  • 举报
回复
估计楼主是拿别人的代码改改。
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
Dim i As Integer
Public Sub xxjfshowtitle()
MSF1.Clear
Dim i As Integer
With MSF1
.Cols = 6

.TextMatrix(0, 1) = "学期"
.TextMatrix(0, 2) = "本次交费(元)"
.TextMatrix(0, 3) = "本次欠费(元)"
.TextMatrix(0, 4) = "日期"
.TextMatrix(0, 5) = "操作员"

.ColWidth(0) = 200
.ColWidth(1) = 2200
.ColWidth(2) = 1500
.ColWidth(3) = 1500
.ColWidth(4) = 1500
.ColWidth(5) = 1200

.FixedRows = 1
For i = 1 To 5
.ColAlignment(i) = 6
Next i

.FillStyle = flexFillSingle
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
.Row = 1
End With
End Sub
Public Sub xxxuefeidata()
Dim mrc As ADODB.Recordset
Dim mrc1 As ADODB.Recordset
txtsql = "select jf.学号,xj.姓名,xj.班级,jf.学期,jf.交费,jf.欠费,jf.日期,jf.操作员 from jf inner join xj on jf.学号=xj.学号 where jf.学号='" & Trim(frmjf2.MSF1.TextMatrix(frmjf2.MSF1.Row, 1)) & "' order by jf.日期"
Set mrc = ExecuteSQL(txtsql)
txtsql = "select 学号,sum(交费),sum(欠费) from jf where 学号='" & Trim(frmjf2.MSF1.TextMatrix(frmjf2.MSF1.Row, 1)) & "' group by 学号 order by 学号"
Set mrc1 = ExecuteSQL(txtsql)
Dim j As Integer
Dim i As Integer
If mrc.EOF = True Then
MSF1.Clear
Exit Sub
End If
mrc.MoveFirst
With MSF1
.Rows = 3
.Row = 1
Do While Not mrc.EOF
.Rows = .Rows + 1
For i = 0 To 2
Text1(i) = mrc.Fields(i)
Next i
.TextMatrix(.Row, 1) = mrc.Fields(3)
.TextMatrix(.Row, 2) = "¥" & Format(mrc.Fields(4), "0.00")
If Val(mrc.Fields(5)) >= 0 Then
.TextMatrix(.Row, 3) = "¥" & Format(mrc.Fields(5), "0.00")
Else
.TextMatrix(.Row, 3) = "-¥" & Format(-Val(mrc.Fields(5)), "0.00")
End If
.TextMatrix(.Row, 4) = mrc.Fields(6)
.TextMatrix(.Row, 5) = mrc.Fields(7)

.Row = .Row + 1
mrc.MoveNext
Loop
' .MergeCells = flexMergeFree

' .MergeRow(6) = True
'.MergeCol(1) = True
'.MergeCol(2) = True
' .MergeCol(3) = True
' .MergeCol(4) = True
.Row = .Row + 1
.Col = 1
MSF1.CellForeColor = vbRed
.TextMatrix(.Row, 1) = "累计交费:"
.Col = 2
MSF1.CellForeColor = vbRed
.TextMatrix(.Row, 2) = "¥" & Format(mrc1.Fields(1), "0.00") & " 元"
.Col = 4
MSF1.CellForeColor = vbRed
.TextMatrix(.Row, 4) = "累计欠费:"
.Col = 5
MSF1.CellForeColor = vbRed
.TextMatrix(.Row, 5) = "¥" & Format(mrc1.Fields(2), "0.00") & " 元"

End With

End Sub

Private Sub Form_Activate()
xxjfshowtitle
xxxuefeidata
End Sub

Private Sub MSF1_Click()
Text2.Visible = False
MSF1.SetFocus
End Sub

Private Sub MSF1_DblClick()
With MSF1
Dim c As Integer
Dim r As Integer
r = .Row
c = .Col
If c = 1 Or r = .Rows - 1 Or r = .Rows - 2 Then
Dim ss As String
ss = MsgBox("该项不能修改!", vbExclamation + vbOKOnly, " 警告")
Exit Sub
End If
qxstr = Executeqx(3)
If qxstr = "readonly" Then
ss = MsgBox("对不起,你是只读用户不能修改记录,请与管理员联系!", vbInformation + vbOKOnly, " 警告")
Exit Sub
End If
Text2.Top = .Top + .RowPos(r) + 15
Text2.Left = .Left + .ColPos(c) + 25
Text2.Width = .ColWidth(c)
Text2.Height = .RowHeight(r) - 15
Text2.Text = .Text
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
Text2.Visible = True
Text2.SetFocus

End With
End Sub



Private Sub Text2_KeyPress(KeyAscii As Integer)
Dim shao As Integer
Dim zs As String
If KeyAscii <> 8 And KeyAscii <> 13 Then
shao = InStr(Trim(Text1(Index).Text), ".")
If shao <> 0 Then
zs = Right(Trim(Text1(Index).Text), Len(Trim(Text1(Index).Text)) - shao)
If Len(zs) > 1 Then KeyAscii = 0
End If
End If
Select Case MSF1.Col
Case 2
If KeyAscii = 13 Or KeyAscii = 46 Or KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 8 Then
Else
KeyAscii = 0
Exit Sub
End If
Case 3
If KeyAscii = 13 Or KeyAscii = 46 Or KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 8 Then
Else
KeyAscii = 0
Exit Sub
End If
Case 4
If KeyAscii = 13 Or KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 8 Or KeyAscii = 47 Or KeyAscii = 45 Then
Else
KeyAscii = 0
Exit Sub
End If
End Select
If KeyAscii = 13 Then
Dim str As String
Dim mrc As ADODB.Recordset
Select Case MSF1.Col
Case 2
If InStr(Text2.Text, "¥") Then
str = "update jf set 交费=" & Right(Trim(Text2.Text), Len(Trim(Text2.Text)) - 1) & " where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
Else
str = "update jf set 交费=" & Text2.Text & " where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
End If
Set mrc = ExecuteSQL(str)
Case 3
If InStr(Text2.Text, "¥") Then
str = "update jf set 欠费=" & Right(Trim(Text2.Text), Len(Trim(Text2.Text)) - 1) & " where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
Else
str = "update jf set 欠费=" & Text2.Text & " where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
End If
Set mrc = ExecuteSQL(str)
Case 4
If Not IsDate(Text2.Text) Then '判断是否日期格式
ss = MsgBox("应输入日期 mm-dd-yy", vbInformation + vbOKOnly, "警告")
Text2.SetFocus
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
Exit Sub
End If
str = "update jf set 日期=#" & Trim(Text2.Text) & "# where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
Set mrc = ExecuteSQL(str)
Case 5
str = "update jf set 操作员='" & Trim(Text2.Text) & "' where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
Set mrc = ExecuteSQL(str)
End Select
Text2.Visible = False
xxxuefeidata
End If

End Sub


这个也是不好用的那个窗体的代码
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
Private Sub jiaofeifind_Click()
qxstr = Executeqx(3)
If qxstr = "false" Then
ss = MsgBox("对不起,你没有管理本功能的权限,请与管理员联系!", vbInformation + vbOKOnly, " 警告")
Exit Sub
End If
Frmjf3.Show 1
Frmjf3.ZOrder 0
End Sub


这个就是不显示的代码
niyingchao 2008-06-04
  • 打赏
  • 举报
回复
Private Sub MDIForm_Load()
'username = "0001"
DataEnv1.Connection1.ConnectionString = connstring
StatusBar1.Panels(2).Text = Now
StatusBar1.Panels(3).Text = "当前操作员: " & username
Dim aa As String
Select Case Executeqx(1)
Case "admin"
aa = "超级管理员"
Case "readonly"
aa = "只读管理员"
Case Else
aa = "普通管理员"
End Select
StatusBar1.Panels(4).Text = "状态: " & aa
End Sub


这个是mdi主窗体里的代码
ameyume 2008-06-04
  • 打赏
  • 举报
回复
首先检查一下数据库是否连接上。
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Hello.mdb;Persist Security Info=false"


App.path表示当前目录。有的程序写的是绝对目录,看看你下载的程序是怎么写的。
加载更多回复(1)

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧