Access to the remote database

zhaozj2021-02-11  208

Access to remote databases (VB database)

Yang Shangqin

---- Remote Data Object (RDO) is an ODB-based object model based on the ODBC API, which is short, fast, strong, can access any 32-bit ODBC data source, such as SQL Server and Oracle database, is an update to the remote database More advanced tools. ---- The general method of using RDO is as follows. ---- First declare the variable: public con assersult set, RDoEngine, set the default parameters such as RDOEngine, set users and passwords; with rDoEngine.rdodefaultuser = "sa" "user is sa.rdodefaultpassword =" pass "The" password is pass.rdodefaultcursordriver = rduseserver.rdodefaultlogintimeout = 15nd with ---- again connected to the remote database you want to access (available using DSN Connection and DSN-Less Connection). ---- Using DSN Connection Examples (Link Server Server): SET CON = RDOENVIRONMENTS (0) .openConnection ("Hotel", RDDrivernoprompt, false) ---- Using DSN-Less Connection (Connection Server Server The database hotel: set con = rdoenvironments (0) .openConnection ("", RDDrivernoprompt, false, _ "driver = {sql server}; server = server; database = hotel") ---- Establish a connection, You can use the OpenResultSet method to perform queries and processes the result set, but also use the Execute method to perform an action query including data definitions and data operations. For example: set res = con?openResultset ("Select * from menu", rdopenStatic) Con.Execute "Create View Menu_View As SELECT code, dismnive from menu", RDEXECDIRECT ---- RDO's most powerful and most important feature Yes: it can query and process the result returned by the stored procedure, no matter how complicated it. ---- In addition to RDO, you can also use RDC to access remote data libraries. ---- Remote Data Control (RDC) is similar to the data control (DC), and is not always the RDC to connect to the ODBC driver program system with RDO, while DC is connected to the Jet Database Engine with DAO.

转载请注明原文地址:https://www.9cbs.com/read-4877.html

New Post(0)