When VB was first used more than a decade ago, it started from data binding. Later, I began to "disdain" this simple and silly operation and gradually transitioned to SQL statements: almost all database operations are completed using SQL, which is quite self-defeating. Later, I switched to Asp.net, where a large number of databases were accessed on the page, forcing myself to gradually form its own page Switching Module to simplifyCodeQuantity.
Today, I wrote another database.ProgramWe found that with the adodc control, we can quickly implement interaction between data and controls, with almost no code.
The method is simple. After adding adodc, you can configure the connection and query to specify the associated control. Then cancel the connection and query.
Load Code:
Ad. connectionstring = OCN. connectionstring
Ad. recordsource = "select * From mapdata where codenum = '" & codenum &"'"
Ad. Refresh
Add code:
Ad. connectionstring = OCN. connectionstring
Ad. recordsource = "select * From mapdata where 1 = 2"
Ad. Refresh
Ad. recordset. addnew
Update code:
Ad. recordset. Update