Delphi2005 discussed four

xiaoxiao2021-03-06  42

The author encountered the following problems when debugging its own DBWEBFILTERSAMPLE with Delphi2005: If the Active property of BDPDataAdapter1 is set to True, the compile runs the following error.

Server errors in the / dbwebfiltersample application. -------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------ Check the stack tracking information to learn more about the error and the code caused in the code. Exception Details: Borland.Data.Common.BdpException: Connection open failed unavailable database error sources: line 288: Self.DBWebDataSource1.ErrorDlgForeColor:. = System.Drawing.Color.Black; line 289: Include (Self.Load, Self. the Page_Load); line 290:. (System.ComponentModel.ISupportInitialize (Self.BdpDataAdapter1)) EndInit; line 291:. (System.ComponentModel.ISupportInitialize (Self.Employees)) EndInit; line 292: (System.ComponentModel.ISupportInitialize (Self .DATATABLE1)). Endinit;

Source file: g: / program files / borland / bds / 3.0 / demos / delphi.net / dbweb / webfilter / Webform1.PAS line: 290 Stack Tracking: [BDPEXCEPTION: Connection Open Faled. Unavailable Database] borland.Data.Provider. BdpDataAdapter.e () Borland.Data.Provider.BdpDataAdapter.EndInit () WebForm1.TWebForm1.InitializeComponent () in G: /ProgramFiles/Borland/BDS/3.0/Demos/Delphi.Net/DBWeb/WebFilter/WebForm1.pas: 290 WebForm1.TWebForm1.OnInit (EventArgs e) inG: / Program Files / Borland / BDS / 3.0 / Demos / Delphi.Net / DBWeb / WebFilter / WebForm1.pas: 344 System.Web.UI.Control.InitRecursive (Control namingContainer) System .Web.ui.page.processRequestMain () ---------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------- Version information: Microsoft .NET Framework version: 1.1 .4322.573; ASP.NET version: 1.1.4322.573 Active if BDPDataAdapter1

The attribute is set to false, the following error appears: "/ dbwebfiltersample" application in the application in the application. -------------------------------------------------- ------------------------------ Enter the format of the input string is incorrect. Description: Execute an unprocessed exception during the current web request. Check the stack tracking information to learn more about the error and the code caused in the code. Abnormal Details: System.Formatexception: The format of the input string is incorrect. Error Source: Line 325: else Line 326: sCurrentFilter: = Convert.ToString (o); line 327: StartCustId: = Convert.ToInt16 (ListBox1.SelectedValue); line 328: EndCustId: = Convert.ToInt16 (ListBox2.SelectedValue); Row 329: if startcustid

Since I test, I use Delphi2005 to implement web queries, slightly modify the above small errors, compile operation does not have an error, but do not display any data. In order to display the data, the author adds a button on the WebForm1 design form: if not bdpdataadapter1.activethenbdpdataadapter1.activethenbdpdataadapter1.active: = true; Compilation Run Click this button, the following error appears: "/ dbwebfiltersample" Application server error. -------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------ Check the stack tracking information to learn more about the error and the code caused in the code. Abnormal Details: borland.data.common.bdpexception: Connection Open failed. UNAVAILABLE DATABASE source error: line 301: if not bdpdataadapter1.active the line 303: bdpdataadapter1.active: = true; // This sentence is missed 304: END; source file: G: /ProgramFiles/Borland/BDS/3.0/Demos/Delphi.Net/DBWeb/WebFilter/WebForm1.pas line: 303 stack trace: [BdpException: Connection open failed.unavailable database] Borland.Data.Provider.BdpDataAdapter .e () Borland.Data.Provider.BdpDataAdapter.set_Active (Boolean value) WebForm1.TWebForm1.Button1_Click (Object sender, EventArgs e) in G: /ProgramFiles/Borland/BDS/3.0/Demos/Delphi.Net/DBWeb/WebFilter /WebForm1.pas:303 System.Web.UI.WebControls.Button.OnClick (EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (String eventArgument) System.Web.UI. Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent (NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain () ---------------- -------------------------------- ------------------------------- Version information: Microsoft .NET Framework version: 1.1.4322.573; ASP.NET version: 1.1.4322.573

Check the help file carefully, the Active property of BDPDataAdapter1 is set to True, but it will not work so after setting. It is definitely a problem with the database connection, but in the design state, there is no problem, so the re-button event is added to the database to connect all properties, compile, click, and the fault is still. Retrieve the help files carefully, there is the following: TOTO SET UP A Connection 1.in Borland Data Provider: Connections Editor, SELECT The Appropriate Item from The Connections List. 2.in Connection Settings, Enter the Database Path. Note: if Referring to a database on the local disk, prepend the path with localhost :. If using Interbase, for example, you would enter the path to your Interbase database: localhost: C: / Program Files / Borland / Interbase / Examples / Database / employee. gdb (or whatever the actual path might be for your system) .3.Complete the UserName and Password fields for the database as needed. 4.Click Test to confirm the connection. A dialog appears confirming the status of the connection.

5.Click OK to return to the Borland Data Provider:. Connections Editor dialog 6.Click OK to return to the Data Adapter Configuration dialog In the Command tab, the areas for Tables and Columns are updated with information from your connection..

Thus the BdpConnection1 ConnectionString property to databas = localhost: g: /ProgramFiles/Borland/Interbase/Examples/Database/employee.gdb; assembly = Borland.Data.Interbase, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 91d62ebb5b0d1b1b ; VendorClient = gds32.dll; provider = interbase; username = sysdba; password = masterkeybdpdataadapter1 Active property is set to TRUE

Remove the add button and its code, compile the run again, everything is normal.

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

New Post(0)