In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the method of compiling ADO code". In the daily operation, I believe that many people have doubts about the method of compiling ADO code. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what is the method of ADO code compilation?" Next, please follow the editor to study!
During the execution of ADO code, the operation of executing the stored procedure is similar to the above SQL statement, except that the CommandText parameter is no longer the SQL statement, but the name of the stored procedure, such as Demo. Another difference is that in Execute () the argument is made by adCmdText (execute the SQL statement).
Change to adCmdStoredProc to execute the stored procedure. If there are input and output parameters in the stored procedure, you need to use another smart pointer, _ ParameterPtr, to set the parameter information to be input and output one by one, and assign it to the Parameters parameter in _ CommandPtr to transmit information. Readers interested in ADO code can find relevant books or MSDN on their own. The ADO code that executes the stored procedure is as follows:
_ CommandPtr mSecretpCommandd; m_pCommand.CreateInstance (_ _ uuidof (Command)); mSecretpCommandd- > ActiveConnection = msancpConnectionmSecretpCommandd> CommandText = "Demo"; mSecretpCommandd- > Execute (NULL,NULL, adCmdStoredProc); try {mleavpRecordset-> Open ("SELECT * FROM DemoTable", theApp.m_pConnection.GetInterfacePtr (), adOpenDynamic, adLockOptimistic, adCmdText);} catch (_ com_error * e) {AfxMessageBox (e-> ErrorMessage ());}
Move the record pointer. The moving record pointer can be moved to a * * record by the MoveFirst () method, to a record by the MoveLast () method, to the previous record of the current record by the MovePrevious () method, and to the next record ADO code of the current record by the MoveNext () method. But sometimes we often need to move the recording pointer to any recording location at will.
You can use the Move (record number) method to achieve, note: the ADO code method is relative to the current record to move the pointer position, positive values move backward, negative values move forward, such as: Move (3), the current record is 3, it will move 3 record positions back from record 3.
At this point, the study of "what is the method of compiling ADO code" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.