如:
[database]
liangjie=Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=cw;Data Source=MP
如何查找出单词‘cw’
关于附加数据库的操作不知道高手门是如何做的!
[database]
liangjie=Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=cw;Data Source=MP
如何查找出单词‘cw’
关于附加数据库的操作不知道高手门是如何做的!
(将本目录的数据库文件通迅录_Data.MDF,通迅录_Log.LDF连入);
var S:String;
begin
s:='EXEC sp_attach_db @dbname = N'+char(39)+'通迅录'+char(39)+','+
'@filename1 = N'+char(39)+ExtractFilePath(paramstr(0))+'通迅录_Data.MDF'+char(39)+
','+'@filename2 = N'+char(39)+ExtractFilePath(paramstr(0))+'通迅录_Log.LDF'+char(39);
ADOCommand.CommandText := s;
ADOCommand.Execute();
Messagebox(handle,'数据库安装成功!','提醒',MB_OK+MB_ICONINFORMATION);
end;
////向sql中加入你的数据表.
中查找
‘cw’这个单词!这是在ini文件中的。
因为
‘sp_attach_db ‘cw’’的使用要连接一个数据库吧,
成功之后,在连接cw这个数据库。要更改ini文件啊。
S: string;S := 'liangjie=Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;UserID=sa;Initial Catalog=cw;Data Source=MP';
if Pos('cw', S) > 0 then
ShowMessage('找到cw')
else
ShowMessage('没有找到cw');