用的是sqlServer数据库,在我的数据库中有一名为HS数据库,
如何设置SQLConnection的属性,使SQLConnection能连上HS数据库。
如何设置SQLConnection的属性,使SQLConnection能连上HS数据库。
解决方案 »
- 关于组件create方法中初始化相关属性的问题
- 请问如何将string转换成pansichar类型
- 各位大侠,来俺就给分!程序中的最后的唯一问题
- 如何从硬盘安装delphi5.0?
- 怎样在TImage中加入鼠标点击坐标?及对图像做裁剪?
- 如何用query和table控件分别动态的连接foxbase数据库啊!???????
- 小弟接了一个图书管理系统?大家来讨论讨论!
- 那位高手有treeview和listview的一些示例,高分相送!
- 但搞来搞去就是不行
- 急急急~~~ 会用fastreport控件的朋友麻烦进来帮个忙
- 高手请指点,应用服务器如何删除?
- 这是一本书里带的数据库密码的加密解密代码,这是什么算法啊?有名称吗?
!
hostname --- 主机名或ip地址
database --- hs
user_name --- 用户
password --- 密码
楼上说得很明白了,design-time直接双击打开就是了,简单得很;
若动态生成,抄下面几行(copy from dfm文件)也就完事了:
DriverName = 'MSSQL'
GetDriverFunc = 'getSQLDriverMSSQL'
LibraryName = 'dbexpmss.dll'
LoginPrompt = False
Params.Strings = (
'DriverName=MSSQL'
'HostName=localhost'
'DataBase=misc'
'User_Name=sa'
'Password='
'BlobSize=-1'
'LocaleCode=0000'
'MSSQL TransIsolation=ReadCommited'
'OS Authentication=True')
VendorLib = 'oledb'
if not ado.Connected then
begin
s:=extractfilepath(application.ExeName);
ti:=tinifile.Create(s+'zhxuf.ini');
try
try
begin
s:=ti.ReadString('database','liangjie','');
ado.ConnectionString:=s;
ado.Connected:=true ;
end;
except
while not ado.Connected do
try
if not ado.Connected then
begin
s:=PromptDataSource(0,'');
ado.ConnectionString:=s;
ado.Connected:=true;
ti.WriteString('database','liangjie',s);
end;
except
if application.MessageBox('数据库连接错误,是否继续连接?','系统提示:',mb_yesno)=idno then
application.Terminate;
end;
end;
finally
ti.Free;
end;
end;
end;
wilowind(无风雪亦飘)
RamjetZhang(王小桃)
所说即可。
ADOConnection的属性ConnectionString后又...,双击