| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1265 人关注过本帖
标题:我用VB做个了3层结构的东西,用户层是网页,在VB里运行没有问题,但生成网页 ...
取消只看楼主 加入收藏
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
 问题点数:0 回复次数:13 
我用VB做个了3层结构的东西,用户层是网页,在VB里运行没有问题,但生成网页后就有

我用VB做个了3层结构的东西,用户层是网页,在VB里运行没有问题,但生成网页后就有这个问题。。请问怎样解决?

图片附件: 游客没有浏览图片的权限,请 登录注册

搜索更多相关主题的帖子: 网页 结构 用户 运行 
2006-12-07 19:59
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 
请各位帮帮忙。。让小弟尽快解决问题。。谢谢

不喜欢编程...但我别无选择...
2006-12-07 20:02
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 
这次惨了。。

不喜欢编程...但我别无选择...
2006-12-07 20:22
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 

请问在哪加啊?


不喜欢编程...但我别无选择...
2006-12-07 21:56
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 
好的,谢谢。。。
但我还是有点不太懂,能给个例子我吗?
我刚学/

[此贴子已经被作者于2006-12-7 22:03:14编辑过]


不喜欢编程...但我别无选择...
2006-12-07 22:02
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 
人呢?

不喜欢编程...但我别无选择...
2006-12-07 22:24
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 
喔。。我试试。。先谢谢

不喜欢编程...但我别无选择...
2006-12-07 22:27
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 
还是不行。。。真不知道怎么搞了?

不喜欢编程...但我别无选择...
2006-12-07 22:31
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 

以下是com组件
Private cn As New ADODB.Connection
Private rs As New ADODB.Recordset
Private recCount As Integer
Private saveRecCount As Integer
Private Sub Class_Initialize()
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open (App.Path & "\library.mdb")
rs.Open "Select * from popedom", cn, adOpenDynamic, adLockOptimistic
recCount = 0
Do While Not rs.EOF
rs.MoveNext
recCount = recCount + 1
Loop
If recCount > 0 Then rs.MoveFirst
End Sub
Private Sub Class_Terminate()
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
End Sub

Public Property Get myRecCount() As Integer
myRecCount = recCount
End Property
Public Property Get userName() As String
userName = rs.Fields(0)
End Property
Public Property Get userPassword() As String
userPassword = rs.Fields(1)
End Property
Public Property Get userType() As String
userType = rs.Fields(2)
End Property
Public Function userPrevious() As Integer
If recCount > 0 Then
rs.MovePrevious
If Not rs.BOF Then
myPrevious = 0
Else
rs.MoveFirst
userPrevious = -1
End If
Else
userPrevious = -1
End If
End Function

Public Function userNext() As Integer
If recCount > 0 Then
rs.MoveNext
If Not rs.EOF Then
userNext = 0
Else
rs.MoveLast
userNext = 1
End If
Else
userNext = 1
End If
End Function

Public Function userSearch(ByVal searchName As String) As Integer
rs.Filter = "User Like '" & searchName & "*'"
saveRecCount = recCount
recCount = 0
Do While Not rs.EOF
rs.MoveNext
recCount = recCount + 1
Loop
If recCount > 0 Then rs.MoveFirst
userSearch = recCount
End Function

Public Sub reSetRec()
rs.Filter = adFilterNone
recCount = saveRecCount
End Sub

Public Function userUpdate() As Integer
rs.Update
End Function
Public Function userDelete() As Integer
rs.Delete
rs.MovePrevious
End Function
Public Function userAdd() As Integer
rs.AddNew
End Function
Public Property Get myRec() As Recordset
Set myRec = rs
End Property

以下是页面代码:
Dim myData As paul.Class1

Private Function cmdAdd_onclick() As Boolean
txtUser.disabled = False
txtPassword.disabled = False
txtType.disabled = False
cmdNext.disabled = True
cmdPrevious.disabled = True
cmdModify.disabled = True
cmdDelete.disabled = True
cmdAdd.disabled = True

txtUser.focus

myData.userAdd

txtUser.Value = ""
txtPassword.Value = ""
txtType.Value = ""
End Function

Private Function cmdDelete_onclick() As Boolean
myData.userDelete
txtUser.Value = myData.userName
txtPassword.Value = myData.userPassword
txtType.Value = myData.userType
End Function
Private Function cmdUpdate_onclick() As Boolean
If txtUser.Value = "" Or txtPassword.Value = "" Or txtType.Value = "" Then
MsgBox "ÐÅÏ¢¶¼²»ÄÜΪ¿Õ£¬Çë¼ì²éÔÙÊäÈë¡£", , "Ìáʾ"
Else
myData.userUpdate

Let myData.myRec.Fields(0) = txtUser.Value
Let myData.myRec.Fields(1) = txtPassword.Value
Let myData.myRec.Fields(2) = txtType.Value

txtUser.disabled = True
txtPassword.disabled = True
txtType.disabled = True
cmdNext.disabled = False
cmdPrevious.disabled = False
cmdModify.disabled = False
cmdDelete.disabled = False
cmdAdd.disabled = False

End If
End Function

Private Function cmdGo_onclick() As Boolean
If txtSearchUser.Value <> "" Then
Dim i As Integer
i = myData.userSearch(txtSearchUser.Value)
If i > 0 Then
dspResult.innerText = "ÕÒµ½·ûºÏÌõ¼þµÄ¼Ç¼Êý£º" & i
txtUser.Value = myData.userName
txtPassword.Value = myData.userPassword
txtType.Value = myData.userType
Else
dspResult.innerText = "ûÓÐÕÒµ½·ûºÏÌõ¼þµÄ¼Ç¼¡£"
End If
Else
MsgBox "ÇëÊäÈëÒª²éÕҵĹؼü´Ê¡£", , "Ìáʾ"
End If
End Function

Private Function cmdModify_onclick() As Boolean
txtUser.disabled = False
txtPassword.disabled = False
txtType.disabled = False
cmdNext.disabled = True
cmdPrevious.disabled = True
cmdModify.disabled = True
cmdDelete.disabled = True
cmdAdd.disabled = True

txtUser.focus
End Function

Private Function cmdNext_onclick() As Boolean
If myData.userNext = 0 Then
txtUser.Value = myData.userName
txtPassword.Value = myData.userPassword
txtType.Value = myData.userType
End If
End Function
Private Function cmdPrevious_onclick() As Boolean
If myData.userPrevious = 0 Then
txtUser.Value = myData.userName
txtPassword.Value = myData.userPassword
txtType.Value = myData.userType
End If
End Function
Private Function cmdRecAll_onclick() As Boolean
If Not dspResult.innerText = "µ±Ç°¼Ç¼×ÜÊý£º" & myData.myRecCount Then
myData.reSetRec
dspResult.innerText = "µ±Ç°¼Ç¼×ÜÊý£º" & myData.myRecCount
txtUser.Value = myData.userName
txtPassword.Value = myData.userPassword
txtType.Value = myData.userType
Else
cmdRecAll.disabled = False
End If
End Function
Private Sub DHTMLPage_Load()

Set myData = New paul.Class1
dspResult.innerText = "µ±Ç°¼Ç¼×ÜÊý£º" & myData.myRecCount
txtUser.Value = myData.userName
txtPassword.Value = myData.userPassword
txtType.Value = myData.userType
End Sub

Private Sub DHTMLPage_Unload()
Set myData = Nothing
End Sub

[此贴子已经被作者于2006-12-8 10:01:21编辑过]


不喜欢编程...但我别无选择...
2006-12-08 09:50
yutian_0130
Rank: 1
等 级:新手上路
帖 子:155
专家分:0
注 册:2006-12-2
收藏
得分:0 
在VB里运行是没有错误的,但生成网页后就出现了一楼图片的错误,请问怎样处理?

不喜欢编程...但我别无选择...
2006-12-08 09:51
快速回复:我用VB做个了3层结构的东西,用户层是网页,在VB里运行没有问题,但生 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019234 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved