It should be a lot of netizens and beginners, I will explain the PowerBuilder database configuration method, I hope to help beginners:
First enter the PowerBuilder home page:
1. Select "Database Profile" in the Tool menu of the PB main menu to enter an interface 2. Locate the Oracle location in Installed Database Interfaces, make sure it is selected, select the button "New" to create a database name [such as: orcl] 3 In the pop-up window, select the TAB page for Connection: 4. In PROFILE NAME: Enter the database name you want to create, here is ORCL 5. In Connect Information: 6. Server: Here you in Net8 Easy Configers Database server name 7.login ID: Enter the user ID 8.password you connect to the database: Enter the user password you connect to the database 9. Go to the System Tab page: Powerbuilder Catalog Table Owener: System [This is changeable ] Press: "Apply" or "OK". Return to the Database Profiles interface: 10. Select the database you just created and connect "Connect" connection. ***** Of course, you can choose the database you created, then select Edit to enter a interface "Database Proile Setup", select the Preview page, use the code COPY to the code to your application Open You can in the event. // Profile orcl sqlca.dbms = "O84 ORACLE8 / 8I (8.x.4 )" SQLCA.Logpass = "password" sqlca.serverName = "sername" sqlca.logid = "userid" sqlca.autocommit = false sqlca. DBPARM = "Pbcatalog Nowner = 'orcl'" setpointer (hourglass!) Connect use SQLCA;
File: // Database connection successfully opened the main window Open (w_main) if sqlca.sqlcode <> 0 Then MessageBox ("Cannot Connect to Database", Sqlca.sqlerrtext) HALT RETURN END IF These lines of lines are specific connection code, As long as you have modified it to your own database name and user name user password. If you perform a database connection to a dynamic, you can create an INI file, write the code connected to the database to the INI file, so that the database is dynamically connected. Specific INi file code content: [DataBase] DBMS = ODBC Database = UserID = DatabasePassword = ServerName = LogId = LogPassword = DbParm = ConnectString = 'DSN = dagang; UID = kantmis; PWD = kantmis' Prompt = 0 is a problem for If you want to see the data in the window when you open, you can write the following code directly in the OPEN event of the form: dw_1.settransObject (SQLCA) dw_1.Retrieve () If you want to display data according to your condition, You can define where the WHERE condition is defined directly from SQL of DataWindow. In addition, you can also define the RETRIEVAL Arguments that retrieved, you can query the eligible record.
Author:
Marine
QQ: 53931635 E-mail: haier@hotmail.com