Download presentation
Presentation is loading. Please wait.
Published byAshlyn Harrington Modified over 9 years ago
1
The Tip of the ADO-burg Francisco H Tapia
2
Ado Objects Command Connection Error Parameter Property Record RecordSet Stream
3
Who’s your provider?
4
Connection providers… OLEdb providers – JET – SQL – TEXT – XML – mySQL – Etc…
5
What’s in a command? Excute stored procedures or queries where a result is not expected back –.Execute,, adExecuteNoRecords Pass multiple parameters –.Parameters.Append.CreateParameter("CompanyName", _ adVarWChar, adParamInput, 50, sCompanyName) –.Parameters.Append.CreateParameter("ContactFirstName", _ adVarWChar, adParamInput, 30, sContactFirstName) –.Parameters.Append.CreateParameter("ContactLastName", _ adVarWChar, adParamInput, 50, sContactLastName) Receive a return a single pice of data instead of a recordset… –.Parameters.Append.CreateParameter("RETURN_VALUE", _ adInteger, adParamReturnValue, 0) – ' Print new identity value Debug.Print.Parameters("job_id").Value ' New Identity http://www.able-consulting.com/ADO_Faq.htm
6
Recordsets… Conn.stp_MyStoredProcedure Param1, rs – Store Access queries in MDB BE – Create an updateable recordset on the fly OR Use the Command object to execute the procedure. – Set rs = cmd.execute
7
Dispelling myths… ADO is Faster! Not necessarily, while DAO is optimized for JET, ADO is optimized to take advantage of a whole slew of languages. In reality if you are planning to process thousands of JET records in code, you should look at DAO instead of ADO. SQL for example is using an optimized OLEdb provider vs the ODBC provider, thus ADO is the current supported data access model. ADO requires less code The object model is is flatter thus requiring less coding… MS Access 97 cannot use ADO code False. ADO can be added as a reference in code, and executed the same way in Access 97 as you can in Access 2000/2002. Intellisense is not aware of the ADO library though.
8
LINKS!!! http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmscadoprogrammersguide.asp http://www.able-consulting.com/ADO_Faq.htm http://www.devguru.com/technologies/ado/quickref/ado_index.html http://www.vbsquare.com/databases/begado/\ http://www.vbsquare.com/databases/begado/ www.google.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.