社区
VB基础类
帖子详情
ADO的OPEN语句用到的用户名和密码在ACCESS中如何设置?
一脚滑倒
2001-12-05 09:22:36
另有一个问题:请大家说说三种连接数据库哪个比较好?有什么差别?
...全文
70
3
打赏
收藏
ADO的OPEN语句用到的用户名和密码在ACCESS中如何设置?
另有一个问题:请大家说说三种连接数据库哪个比较好?有什么差别?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
mmzxg
2001-12-05
打赏
举报
回复
根据需要
sonicdater
2001-12-05
打赏
举报
回复
This example uses the Open and Close methods on both Recordset and Connection objects that have been opened.
'BeginOpenVB
'To integrate this code
'replace the data source and initial catalog values
'in the connection string
Public Sub OpenX()
Dim Cnxn As ADODB.Connection
Dim rstEmployees As ADODB.Recordset
Dim strCnxn As String
Dim strSQLEmployees As String
Dim varDate As Variant
' Open connection
strCnxn = "Provider=sqloledb;Data Source=MyServer;Initial Catalog=Pubs;User Id=sa;Password=; "
Set Cnxn = New ADODB.Connection
Cnxn.Open strCnxn
' Open employee table
Set rstEmployees = New ADODB.Recordset
strSQLEmployees = "employee"
rstEmployees.Open strSQLEmployees, Cnxn, adOpenKeyset, adLockOptimistic, adCmdTable
' Assign the first employee record's hire date
' to a variable, then change the hire date
varDate = rstEmployees!hire_date
Debug.Print "Original data"
Debug.Print " Name - Hire Date"
Debug.Print " " & rstEmployees!fname & " " & _
rstEmployees!lname & " - " & rstEmployees!hire_date
rstEmployees!hire_date = #1/1/1900#
rstEmployees.Update
Debug.Print "Changed data"
Debug.Print " Name - Hire Date"
Debug.Print " " & rstEmployees!fname & " " & _
rstEmployees!lname & " - " & rstEmployees!hire_date
' Requery Recordset and reset the hire date
rstEmployees.Requery
rstEmployees!hire_date = varDate
rstEmployees.Update
Debug.Print "Data after reset"
Debug.Print " Name - Hire Date"
Debug.Print " " & rstEmployees!fname & " " & _
rstEmployees!lname & " - " & rstEmployees!hire_date
rstEmployees.Close
Cnxn.Close
Set rstEmployees = Nothing
Set Cnxn = Nothing
End Sub
'EndOpenVB
一脚滑倒
2001-12-05
打赏
举报
回复
我倒!你的回答好简单!
有谁能我如何在ACCESS里设置这些???
ADO
对象操作
ACCESS
代码
ADO
对象操作
ACCESS
代码
ADO
对象操作
ACCESS
代码
VC++
ADO
连接SQLSERVER和
Access
数据库
mfc做的一个对话框,有对
Access
和SQL2000数据库的读取及修改、删除、插入操作。command、execute、
open
3种方式执行sql
语句
。
access
一次执行多条sql
语句
access
一次执行多条sql
语句
! 值得下载看看!资源免费,大家分享!! 更多免费资源 http://ynsky.download.csdn.net/
VC++实现简单的用户登录系统(
ADO
)。包括修改
密码
功能!
VC++实现简单的用户登录系统(
ADO
)。包括修改
密码
功能!初始账号
密码
都是123
VC下用
ADO
读写
Access
数据库的资料及源代码
该资源是本人在VC下用
ADO
读写
Access
数据库期间收集的关于
ADO
数据库的资料,加有VC的列表框。并包含一些源代码,希望能对大家有所帮助!
VB基础类
7,785
社区成员
197,585
社区内容
发帖
与我相关
我的任务
VB基础类
VB 基础类
复制链接
扫一扫
分享
社区描述
VB 基础类
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章