各位老大,如何在Delphi7下判断sqlserver数据库中的某个表是否存在?
通过ADO对象连接上了数据库,如何运行后台存储过程?(用组件免谈!)
wo yao feng le!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11
我通过如下方法连接数据库
var
adoc:variant;
begin
adoc:=createoleobject('adodb.connection');
adoc.open('Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=数据库名;Data Source=服务名');
通过ADO对象连接上了数据库,如何运行后台存储过程?(用组件免谈!)
wo yao feng le!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11
我通过如下方法连接数据库
var
adoc:variant;
begin
adoc:=createoleobject('adodb.connection');
adoc.open('Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=数据库名;Data Source=服务名');
adoquery.sql.text := 'exec yourprocedure';
adoquery.open;如果该存储过程不返回结果用adoquery.execsql;
SQL.Add('select Name from sysObjects where name=''YourTableName'' and Type=''u''');
open;
...
if RecordCount = 1 then
ShowMessage('存在')
else
ShowMessage('不存在');