各位大哥:我的毕业设计,用DELPHI+SQL SERVER,我用兵SQL 做了实现查询和插入的所有的存储过程可是我却不知道怎么用BDEStoredProc和AODAStoredProc,我没有地方弄书因为学校隔离了:(    所以请各位大虾给指点指点,我需要最详细的讲解,因为我接触DELPHI才不到场20天。

解决方案 »

  1.   

    How your application uses a stored procedure depends on how the stored procedure was coded, whether and how it returns data, the specific database server used, or a combination of these factors.In general terms, to access a stored procedure on a server, an application must:1 Place the appropriate dataset component in a data module or on a form, and set its Name property to a unique value appropriate to your application.
    2 Identify the database server that defines the stored procedure. Each stored procedure-type dataset does this differently, but typically you specify a database connection component:For TStoredProc, specify a TDatabase component or a BDE alias using the DatabaseName property.
    For TADOStoredProc, specify a TADOConnection component using the Connection property.
    For TSQLStoredProc, specify a TSQLConnection component using the SQLConnection property.For TIBStoredProc, specify a TIBConnection component using the Database property.
    For information about using database connection components, see Connecting to databases3 Specify the stored procedure to execute. For most stored procedure-type datasets, you do this by setting the StoredProcName property. The one exception is TADOStoredProc, which has a ProcedureName property instead.
    4 If the stored procedure returns a cursor to be used with visual data controls, add a data source component to the data module, and set its 
    DataSet property to the stored procedure-type dataset. Connect data-aware components to the data source using their DataSource and DataField properties.5 Provide input parameter values for the stored procedure, if necessary. If the server does not provide information about all stored procedure parameters, you may need to provide additional input parameter information, such as parameter names and data types. For information about working with stored procedure parameters, see Working with stored procedure parameters.
    6 Execute the stored procedure. For stored procedures that return a cursor, use the Active property or the Open method. To execute stored procedures that do not return any results or that only return output parameters, use the ExecProc method at runtime. If you plan to execute the stored procedure more than once, you may want to call Prepare to initialize the data access layer and bind parameter values into the stored procedure. For information about preparing a query, see Preparing stored procedures.7 Process any results. These results can be returned as result and output parameters, or they can be returned as a result set that populates the stored procedure-type dataset. Some stored procedures return multiple cursors. For details on how to access the additional cursors, see Fetching multiple result sets.
      

  2.   

    1.设定DatabaseName属性(bde)或connection属性(ado)
    2.设定StoredProcName属性
    3.设定参数(parameter)信息。
    4。执行