在bcb中如何实现一个与sql server 2000有关的问题

xiaokange 2003-08-21 10:24:20
在C++ builder 中,如何实现在自动设立好sql server 2000的用户sa的密码的前提下,自动删除其他所有用户并实现自动备份数据库
...全文
96 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
52vc 2003-09-16
  • 打赏
  • 举报
回复
网络备份可以这样实现 ,在服务器上连接网络驱动器,就可以备份过去了!
myan18 2003-09-15
  • 打赏
  • 举报
回复
恢复数据库:
RESTORE DATABASE 数据库名 FROM DISK ='备份文件路径'
CACACACACA 2003-09-15
  • 打赏
  • 举报
回复
是删除数据库中的所有用户,还是要断开所有用户
xiaokange 2003-09-14
  • 打赏
  • 举报
回复
大虾帮帮忙啊!
xiaokange 2003-09-08
  • 打赏
  • 举报
回复
TO:ljianq
自动备份我已经解决,但是有没有方法把数据备份到分机上!用emt格式能够恢复备份吗?
52vc 2003-08-31
  • 打赏
  • 举报
回复
看书吧!
gdyt007 2003-08-29
  • 打赏
  • 举报
回复
查下sql server使用手册就行了!
Guade 2003-08-28
  • 打赏
  • 举报
回复
文件的后缀应该是.db
zihan 2003-08-27
  • 打赏
  • 举报
回复
备份的是 : BACKUP DATABASE a To Disk Path a表示数据库名称,Path是你备份的路径
52vc 2003-08-27
  • 打赏
  • 举报
回复
up
ljianq 2003-08-22
  • 打赏
  • 举报
回复
对不起!
在adoQuery->SQL->Text=sCmd后加:
adoQuery->ExecSQL();
ljianq 2003-08-22
  • 打赏
  • 举报
回复
使用ADOQuery执行SQL命令;
删除用户:EXEC sp_dropuser 'username';
备份数据库,以下使我在实际应用中的代码

AnsiString sCmd="Use Master \r\nEXEC sp_addumpdevice 'disk', '";
sCmd+=DBName+"','"+BackupPath+DBName+".emt'\r\n";
sCmd+="BACKUP DATABASE "+DBName+" TO "+DBName+"\r\n";
adoQuery->SQL->Text=sCmd;

if (!FileExists(BackupPath+DBName+".emt"))
return false;
else
return true;
SQL Server Data Access Components 2.45Copyright 1997-2003, Core Lab. All Rights Reserved--------------------------------------------------SQL Server Data Access Components (SDAC) library offers a set ofnonvisual components for Borland Delphi and C++ Builder. They provideaccess to Microsoft SQL Server and are an alternative to a standardway of accessing databases using Borland Database Engine (BDE).SDAC uses OLE DB directly through a set of COM-based interfaces thatexpose data from a variety of sources. OLE DB interfaces provideapplications with uniform access to data stored in diverse informationsources, or data stores. These interfaces support the amount of DBMSfunctionality appropriate to the data store, enabling the data storeto share its data.Using BDE in SQL Server oriented client/server applications has somedeficiencies. In many cases BDE community are unable to employ serverspecific features, they must tolerate excessive usage of resources,reduced speed of processing data, restricted distribution of an applicationand its administration.Using BDE in database applications amounts to the following data pathbetween server and client:[SQL Server] <-> [DBLibrary] <-> [SQL Links] <-> [BDE] <-> [Client application]SDAC works directly through OLE DB, which is a native SQL Serverinterface. Applications with SDAC components access server directly:[SQL Server] <-> [OLE DB] <-> [Client application]Using SQL Server Data Access gives you the following advantages: - No distribution, installation and configuration is required for BDE and ODBC; - You can use any Delphi Professional Edition to develop client/server applications; - Supports SQL Server specific features: windows authentication, metadata, unicode fields, manual refresh for record in a dataset, automatic getting Identity value and results of triggers work and a lot of more; - Simplifies data updating; - Speeds up fetch of records from database; - Provides automatic refresh for records; - Advanced design time editors; - Interface (methods, properties) of SDAC components is similar to those of standard BDE data access components (TDatabase, TQuery, ..); - Supports all data-aware components; - and so on.Compatibility-------------SDAC supports SQL Server 7, SQL Server 2000 and MSDE.SDAC requires OLE DB installed on workstation.Note: in current versions of Microsoft Windows, as Windows 2000, OLE DB is already included as standard package. But it‘s highly recommended to download latest version (newer than 2.5) of Microsoft Data Access Components (MDAC) at http://www.microsoft.com/dataInstallation------------SDAC installer copies these files to folders where they should be resided. sdacXX.bpl - SDAC run-time package (located in WindowsSystem folder) dclsdacXX.bpl - SDAC design-time package (located in DelphiBin folder) sdacvclXX.bpl - VCL support package (located in DelphiBin folder) crcontrolsXX.bpl - TCRDBGrid component (located in DelphiBin folder) Delphi ====== To compile SDAC based application add $(DELPHI)SDACLib to Project Options|Search path. C++ Builder =========== To compile SDAC based application add $(BCB)SDACLib to Project Options|Library path and $(BCB)SDACInclude to Project Options|Include path.Writing GUI applications with SDAC----------------------------------Now SDAC GUI part is standalone. This means that to make available GUI elements such as sql cursors, connect form, connect dialog etc. you should explicitly include SdacVcl unit to your application. This feature is needed for writing console applications. Delphi and C++ Builder ====================== By default SDAC does not require Forms, Controls and another GUI related units. Only TMSConnectDialog component requires Forms unit.Trial version restrictions--------------------------Note following restriction when using SDAC trial version.When SDAC based application is running IDE should be also running.Using several products in one IDE---------------------------------SDAC, ODAC and MyDAC components use common base packages listed below. dacXX.bpl dacvclXX.bpl dcldacXX.bplNote that product compatibility is provided for current build only.In the other words, if you upgrade one of the installed products itmay conflict with older builds of other ones. In order to continue usingproducts simultaneously you should upgrade all of them at the same time.--------------------http://www.crlab.comsdac@crlab.com

1,178

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 数据库及相关技术
社区管理员
  • 数据库及相关技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧