我倒!你的回答好简单!
有谁能我如何在ACCESS里设置这些???
有谁能我如何在ACCESS里设置这些???
解决方案 »
- 双精度问题,急急急,在线等
- 如何获取网卡的物理地址?(我不要注册表里面的网卡地址)解决后马上给分!
- 请问怎样编写从网上下载最新的银行汇率并存入数据库?哪位大侠可以指点下?
- vb处理bcd码的问题
- 郁闷,请大家看看
- 有谁知道activereport自动生成序列号的属性?
- 在vb6.0报表中怎么用“select distinct ..from...”?
- 考考你们!关于编译的问题!
- 出鬼了!这个这个sql成精了!!!!
- 如何处理三维表的关系????建ado对象占系统资源大么?
- 请教:Access中如何设置一个字段的默认值等于另一个字段的值?
- 如何把一个数据库文件(*.db)导出到一个文本文件,同时也可以导入?高分!
'replace the data source and initial catalog values
'in the connection stringPublic 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 = NothingEnd Sub
'EndOpenVB