sqldirect调用sql server存储过程demo

SDDatabase1->DatabaseName = "DB5";
SDDatabase1->ServerType = stOLEDB;
SDDatabase1->LoginPrompt = false;
SDDatabase1->RemoteDatabase = "Provider=SQLNCLI11;Persist Security Info=True;Data Source=192.168.0.230;Initial Catalog=DB5;User ID=db_user_id;Password=db_password";


SDStoredProc1->DatabaseName = SDDatabase1->DatabaseName;
SDStoredProc1->StoredProcName = "sp_spaceused";


SDDatabase1->Connected = true;
SDStoredProc1->Open();


while (!SDStoredProc1->Eof)
{
String database_name = SDStoredProc1->Fields->Fields[0]->AsString;
String database_size = SDStoredProc1->Fields->Fields[1]->AsString;
String unallocated_space = SDStoredProc1->Fields->Fields[2]->AsString;
SDStoredProc1->Next();


ShowMessage(database_name);
ShowMessage(database_size);
ShowMessage(unallocated_space);
}


SDStoredProc1->NextResultSet();


while (!SDStoredProc1->Eof)
{
String reserved = SDStoredProc1->Fields->Fields[0]->AsString;
String data = SDStoredProc1->Fields->Fields[1]->AsString;
String index_size = SDStoredProc1->Fields->Fields[2]->AsString;
String unused = SDStoredProc1->Fields->Fields[3]->AsString;
SDStoredProc1->Next();


ShowMessage(reserved);
ShowMessage(data);
ShowMessage(index_size);
ShowMessage(unused);
}


SDStoredProc1->Close();
SDDatabase1->Connected = false;
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
除unidac外我愛用的一套,可存取不同資料庫,取代掉BDE,僅供各位同好試用,喜歡的話請購買支持開發者。 SQLDirect Component Library is a light-weight Borland Database Engine replacement for Borland/CodeGear/Embarcadero Delphi v.5 - 10, 2010, XE-XE10 and C++Builder v.5 - 2010, XE-XE10. It uses the native application programming interfaces to access to the following SQL-servers: IBM DB2 Universal Database Informix Server Interbase/Firebird Server Microsoft SQL Server MySQL Server Oracle Database Server PostgreSQL Server SQLite Database Sybase Adaptive Server Enterprise and Adaptive Server Anywhere Unify (Centura, Gupta) SQLBase Server ODBC datasources OLEDB datasources Using of SQLDirect Component Library gives you the following advantages: connecting to the following SQL servers using 32-bit native application programming interfaces (API): Centura SQLBase Server 6(+), IBM DB2 Universal Database with CAE v5.2, Informix Server 7.2(+), Firebird, Interbase, MySQL 3.23(+), Oracle Server 7.2(+) with SQL*Net 2.2(+), Microsoft SQL Server, PostgreSQL 7.1(+), SQLite, Sybase Adaptive Server Enterprise and Adaptive Server Anywhere (through Open Client, which is supported by Anywhere ver.6 as native interface), ODBC and OLEDB datasources. no distributing, installing and configuring the BDE or ODBC simultaneous access to the supported servers using Delphi 5, 6, 7, 9(2005), 10(2006), 2007, 2009, 2010, XE-XE7 or C++Builder 5, 6, 2006, 2007, 2009, 2010, XE-XE7 (Pro and above) to develop Client/Server applications query with an updatable result set query with macro support table component thread safe BLOB-fields (including LOB and BFILE for Oracle8) stored procedure support (with mutiple result sets for IBM DB2, Microsoft and Sybase SQL Server) bi-directional and unidirectional result sets cached updates record filtering support of data-aware components InfoPower support using images stored by Centura SqlWindows(or Team Developer) in their proprietary format interfaces (public methods and properties) of SQLDirect components are compatible with standard BDE data access components (TSession, TDatabase, TQuery ..).  Thread Safety Note Thread safety is supported by the following software: Oracle SQL*Net 2.3 or above Centura SQLBase Ver. 7 or above IBM DB2 Ver. 5.2 or above Microsoft SQL Server Ver. 6 or above MySQL Sybase ASE and ASA through OpenClient Ver. 11.1 or above  SQLDirect 6.5 was released. Delphi/C++Builder 10.1 Berlin support ftStream-Parameter support support ftWideString support (SQLBase 11.5+) bugfixes
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值