续:关于BCB5+ADO+ACCESS,高手HELP ME。

zfming 2000-08-23 07:35:00
用ADO数据库编程,ConnectionString中的数据库路径可否在程序中动态生成?
...全文
272 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
zfming 2001-08-06
  • 打赏
  • 举报
回复
呵,这么老的帐都让孙老大发现了,我实在是忘了,请大家原谅,现在给分:)
Wingsun 2001-07-08
  • 打赏
  • 举报
回复
古老的问题,应该给分了!
bruce_zhao 2000-09-29
  • 打赏
  • 举报
回复
To Wingsun:
具体的参数是什么意思?如果我用ADO访问一个DBF文件,该怎么设置?
bruce_zhao 2000-09-29
  • 打赏
  • 举报
回复
To Wingsun:
具体的参数是什么意思?如果我用ADO访问一个DBF文件,该怎么设置?
wu_xin 2000-09-26
  • 打赏
  • 举报
回复
同意wingsun,ACCESS比这简单!
duhorse 2000-09-24
  • 打赏
  • 举报
回复
ConnectionString是一个字串类型,其中的数据库路径,你只要根据实际运行的情况取得正确的数据库文件路径,然后组合为一个正确的ConnectionString字符串,再连接就可以了,主要是知道ConnectionString的组合格式,再取得正确路径就OK。
Wingsun 2000-09-24
  • 打赏
  • 举报
回复
当然可以啊,如下:
AnsiString Con="Provider=SQLOLEDB.1;Persist Security "
"Info=False;Initial Catalog=WLJK;"
"Locale Identifier=2052;"
"Connect Timeout=15;"
"Use Procedure for Prepare=1;"
"Auto Translate=True;"
"Packet Size=4096;";
AnsiString ConnectionString;
ConnectionString=Con;
ConnectionString+="User ID="+User+";";
ConnectionString+="Data Source="+Server+";";
ConnectionString+="Password="+Password+";";
cnCIQDatabase->ConnectionString=ConnectionString;
cnCIQDatabase->Connectted=true;
这是连接SQL Server的。可变的参数是Server Name、Password和User Name.
你可以根据你的需要改变它。
nononono 2000-09-23
  • 打赏
  • 举报
回复
哦哦,是VB.
nononono 2000-09-23
  • 打赏
  • 举报
回复
这回答也不是BCB, 是Delphi. 呵呵
  • 打赏
  • 举报
回复
不好意思,我是用VB实现的,我初学BCB,还不能用BCB来回答,SORRY
  • 打赏
  • 举报
回复
可以动态生成是不是弹出一个DATALINK的对话框?
你可以试试
Public Function GetConnectDSN(ByVal DSN As String) As String
Dim c As DataLinks
Dim d As ADODB.Connection
Set c = New DataLinks
Set d = New ADODB.Connection
d.ConnectionString = DSN
If c.PromptEdit(d) = True Then
GetConnectDSN = d.ConnectionString
mvarLastDSN = d.ConnectionString
mvarConnectResult = True
Else
mvarConnectResult = False
GetConnectDSN = ""
End If
Set d = Nothing
End Function
Tyro 2000-08-23
  • 打赏
  • 举报
回复
不懂什么意思!
FastReport.v4.9.81 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版 delphi2010中文完美支持。 D2010安装必读 delphi2010使用者安装时,请将res\frccD14.exe更名名为frcc.exe frccD14.exe 是专门的delphi2010编码器。其他delphi版本,请使用frcc.exe FASTREPORT® 4.9 VCL - report generator for Delphi CURRENT VERSION Build: 4.9.81 Date: 05/31/10 FastReport®4 VCL is an add-on component that allows your application to generate reports quickly and efficiently. FastReport® provides all the necessary tools to develop reports, including a visual report designer, a reporting core, and a preview window. It can be used in the CodeGear (exBorland) Delphi 4-2010, CodeGear C++Builder 6-2010 and CodeGear RAD Studio environments What's new in the FastReport 4 Report Designer: new XP-style interface the "Data" tab with all report datasets ability to draw diagrams in the "Data" tab code completion (Ctrl+Space) breakpoints watches report templates local guidelines (appears when you move or resize an object) ability to work in non-modal mode, mdi child mode Report Preview: thumbnails Print: split a big page to several small pages print several small pages on one big print a page on a specified sheet (with scale) duplex handling from print dialogue print copy name on each printed copy (for example, "First copy", "Second copy") Report Core: "endless page" mode images handling, increased speed the "Reset page numbers" mode for groups reports crypting (Rijndael algorithm) report inheritance (both file-based and dfm-based) drill-down groups frxGlobalVariables object "cross-tab" object enhancements: improved cells appearance cross elements visible in the designer fill corner (ShowCorner property) side-by-side crosstabs (NextCross property) join cells with the same value (JoinEqualCells property) join the same string values in a cell (AllowDuplicates property) ability to put an external object inside cross-tab AddWidth, AddHeight properties to increase width&height of the cell AutoSize property, abilit

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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