社区
VB基础类
帖子详情
adodb.recordset.recordcount
sdyqingdao
2001-07-20 04:00:23
how to get it at run time?
&,what is link table?
...全文
106
5
打赏
收藏
adodb.recordset.recordcount
how to get it at run time? &,what is link table?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
sdyqingdao
2002-02-04
打赏
举报
回复
结了
wweilinux
2002-01-31
打赏
举报
回复
通过访问注册表,写到run字键中就可开机自动运行。要链接表,先要建一个表,然后将ado控件的database属性设为你建的数据库名,recordsouce属性设为你建的表名。recordset是表中记录集属性,可通过数组对表中字段进行操作。recordcount则是统计表中字段数。
jett
2002-01-31
打赏
举报
回复
什么意思?
ferrytang
2002-01-31
打赏
举报
回复
我来~~~~~
你要问什么?
sdyqingdao
2002-01-31
打赏
举报
回复
谁来留言,让我结贴
vb学生管理系统源代码
vb学生管理系统源代码 部分代码 Public UserName As String Public txtSQL As String 'use to store
record
SQLsentence Public dream As
ADO
DB
.
Record
set
'use to store
record
object Public Msgtext As String '用来存放返回信息 Public OK As Boolean ' 'Public
db
As String Public Sub highlight() With Screen.ActiveForm If (TypeOf .ActiveControl Is TextBox) Then .ActiveControl.SelStart = 0 .ActiveControl.SelLength = Len(.ActiveControl) End If End With End Sub Sub Main() 'Dim Login As New Login 'Login.Show vbModal 'f Not Login.OK Then 'Login Failed so exit app ' End 'End If 'Unload studentmdi ' Set login = New login login.Show End Sub Public Function connectstring() As String connectstring = "Provider=Microsoft.jet.OLE
DB
.3.51;Data source=f:\schoolgroup\school.m
db
" End Function Public Function ExecuteSQL(ByVal SQL As String, Msgstring As String) As
ADO
DB
.
Record
set
Dim cnn As
ADO
DB
.Connection Dim rst As
ADO
DB
.
Record
set
Dim sTokens() As String On Error GoTo ExecuteSQL_Error sTokens = Split(SQL) Set cnn = New
ADO
DB
.Connection cnn.Open connectstring If InStr("INSERT,DELETE,UPDATE", UCase$(sTokens(0))) Then cnn.ExecuteSQL Msgstring = sTokens(0) & "query successful" Else Set rst = New
ADO
DB
.
Record
set
rst.Open Trim(SQL), cnn,
adO
penKeyset, adLockOptimistic Set ExecuteSQL = rst Msgstring = "查询到" & rst.
Record
Count
& " 条记录" 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
企业人事管理信息系统
SQL+VB做成的licit Public gUserName As String Public gUserKind As String Public gEmployeeId As String Public gLoginSucceeded As Boolean Public Const BLUE = &HFF0000 Public Const WHITE = &H80000005 Sub Main() Dim fLogin As New frmLogin '启动登录窗体 fLogin.Show vbModal '装入并显示模式窗体。 If Not gLoginSucceeded Then MsgBox "系统启动失败,请重试!", vbOKOnly + vbExclamation, "警告" End If Unload fLogin End Sub Public Function ConnectString() As String ConnectString = "Provider=SQLOLE
DB
.1;Password=sa;User ID=sa;Initial Catalog=
DB
ManPower;Data Source=127.0.0.1;" End Function Public Function ExecuteSQL(ByVal SQL As String, rst As
ADO
DB
.
Record
set
, _ Optional enableWrite As Boolean = True) As Boolean Dim con As
ADO
DB
.Connection Dim sTokens() As String On Error GoTo Execute_Error sTokens = Split(SQL) Set con = New
ADO
DB
.Connection con.Open ConnectString '打开数据库 Set rst = New
ADO
DB
.
Record
set
If enableWrite Then '读写方式 rst.Open Trim$(SQL), con,
adO
penStatic, adLockOptimistic Else '只读方式 rst.Open Trim$(SQL), con,
adO
penStatic, adLockRe
adO
nly End If ExecuteSQL = True Exit Function Execute_Error: ExecuteSQL = False Exit Function End Function Public Function
DB
Exist(ByVal SQL As String) As Integer Dim con As
ADO
DB
.Connection Dim sTokens() As String Dim flag As String Dim rst As
ADO
DB
.
Record
set
sTokens = Split(SQL) Set con = New
ADO
DB
.Connection con.Open ConnectString flag = ExecuteSQL(SQL, rst, False) '判断该记录是否存在 If rst.
Record
Count
<> 0 Then
DB
Exist = rst.
Record
Count
Else
DB
Exist = 0 End If con.Close End Function Public Function txtIsNull(txt As TextBox) As Boolean If Trim(txt.Text) = "" Then txtIsNull = True txt.SetFocus txt.BackColor = BLUE Else txtIsNull = False End If
php5.3中连接sqlserver2000的两种方法(com与O
DB
C)
1.Com链接,
ADO
DB
.Connection 复制代码 代码如下: $conn = new Com(“
ADO
DB
.Connection”); //实例化一个Connection对象 $connstr = “provider=sqlole
db
;datasource=.;uid=sa;pwd=123456;database=jnold;”; $conn->Open($connstr); $rs = new Com(“
ADO
DB
.
Record
set
”); //实例化一个
Record
count
对象 $rs->Open(‘select * from News where bigclassid = 5
四轨直销系统(四四复制)带计算源码无加密
四轨直销系统(四四复制)带计算源码无加密 后台地址:jzzgg.asp 帐号密码:admin 0 then if isnull(HyWeekRs("MaxComputeWeek")) then MaxComputeWeek=1 else MaxComputeWeek=HyWeekRs("MaxComputeWeek")+1 end if else MaxComputeWeek=1 end if set HyWeekRs=nothing set HyExcelRs=nothing set HyExcelRs=server.CreateObject("
ado
db
.
record
set
") sql = "SELECT HyNumber,isfour FROM HyClub where IsApproved=true " HyExcelRs.Open sql,conn,1,1 j=HyExcelRs.
Record
Count
if j>0 then while (not HyExcelRs.eof) set ComputeRs=server.CreateObject("
ado
db
.
record
set
") sql="" HyNumber=HyExcelRs("HyNumber") isfour=HyExcelRs("isfour") set HyRs888=server.CreateObject("
ado
db
.
record
set
") sql = "select HyManageTotal_Left from HyMoneyAc
count
where HyNumber ='" & HyNumber & "'" HyRs888.Open sql,conn,1,1 if HyRs888.
record
count
=0 then left_old=0 else left_old=HyRs888("HyManageTotal_Left") if left_old="" or isnull(left_old) then left_old=0 end if end if set HyRs888=nothing Left
Count
=0 Middle
Count
=0 MiddleL
Count
=0 Right
Count
=0 If GetHyParentNumber
Count
(HyNumber)=4 Then Left
Count
=GetLeft
Count
Level(HyNumber,1,1,8) Middle
Count
=GetMiddle
Count
Level(HyNumber,1,1,8) MiddleL
Count
=GetMiddleL
Count
Level(HyNumber,1,1,8) Right
Count
=GetRight
Count
Level(HyNumber,1,1,8) End if 'response.write Left
Count
&"|"&Middle
Count
;&"|"&Right
Count
;&"" TeamManageMoney=0 Temp
很好的图书管理系统设计
部分源代码: Private Sub Command1_Click() Dim sql As String Dim param As
ADO
DB
.Parameter Dim cmd As
ADO
DB
.Command Set cmd = New
ADO
DB
.Command Set param = New
ADO
DB
.Parameter sql = "select * from book where [图书编码]= ? " If Command1.Caption = "添加记录" Then Command1.Caption = "确 定" Command2.Enabled = False '屏蔽删除、修改、下一记录、上一记录按钮,避免出现数据库错误 Command3.Enabled = False Command4.Enabled = False cmdmodify.Enabled = False rst.AddNew Else If Text1.Text = "" Then frmMsg.Show frmMsg.notice.Visible = True frmMsg.Text1.Text = "图书编号不能为空!" Command2.Enabled = True Command3.Enabled = True Command4.Enabled = True Command1.Caption = "添加记录" Exit Sub End If With param .Direction = adParamInput .Type = a
dB
STR .Size = 8 .Value = Text1.Text End With cmd.Parameters.Append param cmd.CommandText = sql cmd.CommandType = adCmdText Set cmd.ActiveConnection = con Set rst1 = cmd.Execute If rst1.
Record
Count
> 0 Then frmMsg.Show frmMsg.notice.Visible = True frmMsg.Text1.Text = "此书号已经存在!" rst.Cancel Command2.Enabled = True Command3.Enabled = True Command4.Enabled = True cmdmodify.Enabled = True Command1.Caption = "添加记录" Command2.Enabled = True Exit Sub End If rst.Update Command2.Enabled = True '数据库更新结束后才可以点击其他几个按钮 Command3.Enabled = True Command4.Enabled = True cmdmodify.Enabled = True Command1.Caption = "添加记录" End If End Sub 修改图书记录操作 Private Sub cmdmodify_Click() '修改记录按钮 Dim sqlstr As String Dim rst1 As New
ADO
DB
.
Record
set
Dim param As
ADO
DB
.Parameter Dim cmd As
ADO
DB
.Command Set cmd = New
ADO
DB
.Command Set param = New
ADO
DB
.Parameter sqlstr = "select * from book where [图书编码]= '" & Trim(Text1.Text) & "'" With param .Direction = adParamInput .Type = a
dB
STR .Size = 8 .Value = Text1.Text End With cmd.Parameters.Append param cmd.CommandText = sqlstr cmd.CommandType = adCmdText Set cmd.ActiveConnection = con Set rst1 = cmd.Execute If rst1.
Record
Count
> 0 Then frmMsg.Show frmMsg.notice.Visible = True frmMsg.Text1.Text = "此书号已经存在!" rst.Cancel Exit Sub End If rst.Update frmMsg.Show frmMsg.info.Visible = True frmMsg.Text1.Text = "修改成功!" End Sub 添加职工信息 Private Sub Command1_Click() '添加记录 Dim sql As String Dim param As
ADO
DB
.Parameter Dim cmd As
ADO
DB
.Command Set cmd = New
ADO
DB
.Command Set param = New
ADO
DB
.Parameter sql = "select * from worker where [工号]= ? " If Command1.Caption = "添加记录" Then Command1.Caption = "确 定" Command2.Enabled = False Command3.Enabled = False Command4.Enabled = False rst.AddNew Else If Text1.Text = "" Then frmMsg.Show frmMsg.notice.Visible = True frmMsg.Text1.Text = "职工编号不能为空!" Command2.Enabled = True Command3.Enabled = True Command4.Enabled = True Command1.Caption = "添加记录" Exit Sub End If With param .Direction = adParamInput .Type = a
dB
STR .Size = 8 .Value = Text1.Text End With cmd.Parameters.Append param cmd.CommandText = sql cmd.CommandType = adCmdText Set cmd.ActiveConnection = con Set rst1 = cmd.Execute '检测职工编号是否存在防止主键冲突 If rst1.
Record
Count
> 0 Then frmMsg.Show frmMsg.notice.Visible = True frmMsg.Text1.Text = "此职工编号已经存在!" rst.Cancel Command2.Enabled = True Command3.Enabled = True Command4.Enabled = True Command1.Caption = "添加记录" Exit Sub End If rst.Update Command2.Enabled = True Command3.Enabled = True Command4.Enabled = True Command1.Caption = "添加记录" End If End Sub
VB基础类
7,763
社区成员
197,609
社区内容
发帖
与我相关
我的任务
VB基础类
VB 基础类
复制链接
扫一扫
分享
社区描述
VB 基础类
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章