欢迎来到天天文库
浏览记录
ID:27110895
大小:63.00 KB
页数:6页
时间:2018-12-01
《asp基础学习代码ado与web数据库》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、ADOandWebdatabaseADO(ActiveXDataObject)WebdatabaseisWebtechnologyanddatabasetechniquesWebdatabaseUseCGI(CommonGatewayInterface)VisitWebdatabaseUseIDC(InternetDatabaseConnector)VisitWebdatabaseUseASPandADOvisitWebdatabaseODBC(OpenDataBaseConnection)Databa
2、seconnectiontechnologyDSN(DataSourceName)ADOdatabasevisittechnologyADOcomponentprovidessevenkindsofobjectsandfoursetThemostcommonlyusedisConnectionobject,CommandobjectandRecordsetobjectUsingConnectionobjectcanestablishandmanagementwithagivendatabaseConne
3、ctionUseCommandobjectcanrealizetheflexiblefordatabasequeriesUseRecordsetobjectstorageandprocessingthedatatoreturnresultsConnectionobjectTobeusedinconnectionwiththeestablishmentandmanagementoftheapplicationandthedatabaseSetconn=server.createobject(“ADODB.
4、Connection”)ConnectionobjectthecommonlyusedmethodsOpenmethodConnection.OpenExecutemethodConnection.ExecuteClosemethodConnection.CloseConnectionStringconnectstringAccessOLEDBconnectstringProvider=Microsoft.Jet.OLEDB.4.0;Source=Pointing.MDBfilesofphysicalp
5、athsAccessODBCconnectstringDriver={MicrosoftAccessDriver(*.mdb)};DBQ=pointing.mdbfilesofphysicalpathsRecordsetobjectSetrs=server.createobject(“ADODB.Recordset”)Recordset.openmethodRecordset.opensource,activeconnection,CursorType,LockTypeCursorType:0,defa
6、ultvalue,expresstoopenacanonlymoverecordpointercursor,andnotallowcorrectanyrecords。1,游标可上下移动,可更新删除,所作的修改无法由他人读取。2,打开一个动态类型的游标,可自由移动,可修改记录。3,打开一个静态类型的游标,可自由上下移动,不能修改记录。LockType:1,defaultvalue,以只读方式取得Recordset2,保守式锁定,在对某记录修改时就锁定,修改完后再解除。3,开放式锁定,仅在调用Update方
7、法更新记录时锁定。TheothermethodsofRecordsetAddNew:在记录集的最后添加一条新纪录Close:关闭指定的Recordset对象MoveFirst、MoveLast、MoveNext、MovePrevious、MoveDelete:intherecordsdeleteonecurrentrecordUpdate:将修改后的记录内容保存回数据库Recordset’sattributesBOF:whetherinthefrontofthefirstrecordEOF:whethe
8、rinthebehindofthelastrecordRecordCount:返回记录集的记录条数intheobjectsofRecordset,FieldssetconsistofmanyFieldobjects,everyFieldobject对应于Recordset记录集中的一列。UseFieldobjectandFieldssetcanachieveeveryfieldwhichareineveryrecordtomanage。Co
此文档下载收益归作者所有