关于ADO对象的问题??求助。

ronggang 2003-09-10 10:56:06
每当用 ADO 对象去连接远程数据库时,整个工程会停止在那里,有什么办法可以解决这个问题吗?
...全文
98 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
tangss 2003-09-12
  • 打赏
  • 举报
回复
UP!
飘零风 2003-09-11
  • 打赏
  • 举报
回复
学习中
yijiansong 2003-09-11
  • 打赏
  • 举报
回复
用异步
fafan 2003-09-11
  • 打赏
  • 举报
回复
用异步,写个dll,我有个例子,是关于煮咖啡的,要不要?如要,给我发消息。
gmc007 2003-09-10
  • 打赏
  • 举报
回复
用异步连接
connection.Open ConnectionString, UserID, Password, Options

Options
Optional. A ConnectOptionEnum value that determines whether this method should return after (synchronously) or before (asynchronously) the connection is established

asynchronous operation

An operation that returns control to the calling program without waiting for the operation to complete. Before the operation is complete, code execution continues. See also synchronous operation.
ronggang 2003-09-10
  • 打赏
  • 举报
回复
没用的。
zwbhyy 2003-09-10
  • 打赏
  • 举报
回复

DoEvents
gzqg 2003-09-10
  • 打赏
  • 举报
回复
请问楼上在连接数据库时怎么用DOEVENTS?
正确方法是异步连接!
linda502 2003-09-10
  • 打赏
  • 举报
回复
停在那是因為數據太多。用DoEvents
ronggang 2003-09-10
  • 打赏
  • 举报
回复
多谢楼上两位,我再研究研究 RecordSet 的异步连接方法。
zhouqi66 2003-09-10
  • 打赏
  • 举报
回复
Private WithEvents conn As ADODB.Connection

Private Sub conn_ConnectComplete(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection)
Label1.Caption = "数据库连接成功!"
End Sub

Private Sub Form_Load()
Set conn = New ADODB.Connection
conn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=用户名;Initial Catalog=数据库名;Data Source=服务器名;pwd=密码", , , ADODB.ConnectOptionEnum.adAsyncConnect
End Sub
ronggang 2003-09-10
  • 打赏
  • 举报
回复
致gmc007(江西的佬表):
能不能用中文解释一下,还有我用是的 RecordSet 的,应该如何设置呢?

7,789

社区成员

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

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