Ultradev instance tutorial: 3.2 Creating a database connection
Author:Eve Cole
Update Time:2009-05-30 18:34:59
Chapter 3: Applying Database to Create Dynamic Web Pages
Section 2: Create a database connection
When you see this title, are you going to sigh again? Why haven't you used Ultradev yet? I'm always working on these definitions. Haha, don't worry. To use Ultradev well, the usage environment must be set up. , only after the database connection setting is completed, we can perform various operations on the database. The connection here is related to the data source connection created earlier. Let me explain one by one.
Open the Window -> Data Bindings panel
Click Recordset(Query) to open the Recordset panel, as shown below:
Since we have not established a database connection yet, there is no content in the Connection column. Click Define to create a database connection, and the screen will appear as shown in the figure.
Click New -> Data Source Name (DSN) to establish a new connection, and then the dialog panel for the data source name connection will open. Pull down from the Data Source Name (DSN) column to see the name of the data source named userinfo we created earlier. In fact, you can open the data source (ODBC) from the Define button here instead of opening the data source (ODBC) dialog box from the control panel, and then the creation process is the same. After selecting the DSN, fill in a name in the Connection Name column to facilitate memory. The name here is userinfo. After clicking OK, our database connection is ready.
Created database connection:
Now there is content in the Connection column. Pull down to select the database connection (userinfo) just created, and then the Table column will show which tables are in your database, as shown in the figure, which shows the userinfo table we created. Columns represents your data table fields. The default is ALL, which means all fields are selected. We don't need the Filter and Sort columns yet, we will talk about them later. After all this is done, we have created a record set, and then give this record set an easy-to-remember name, that is, the Name column. Click OK.
Created recordset:
Now that the preparations have been done and the database has been connected, everything is ready. Next time, let me tell you how to display the records in the database.