标题:VB连servers 2000问题
取消只看楼主
yamladdycx
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-9-25
 问题点数:0 回复次数:0 
VB连servers 2000问题
最近想弄个vb数据库,结果还没开始就碰钉子了。
Public conn As New ADODB.Connection
Public re As New ADODB.Recordset
Public addFlage As Boolean

Public Function opencn() As Boolean
Dim mag As String
On Error GoTo strerrmag
Set conn = New ADODB.Connection
conn.ConnectionTimeout = 25
conn.Provider = "sqloledb"
conn.Properties("initial catalog").Value = xzh '服务器名字
conn.Properties("integrated security").Value = "sellsystem" '库名
conn.Properties("user id").Value = "sa"
conn.Properties("password").Value = "sa"
conn.Open
opencn = True
addflag = ture
Exit Function
strerrmag:
    mag = "data can't connect"
    Call MsgBox(mag, vbOKOnly, "error:data connect")
    addflag = False
    Exit Function
   
End Function

Private Sub Command1_Click()
Call opencn
End Sub
这是代码,本人绝对没有写错,就是连不上,而且用ADO能够连上那个数据库。郁闷死,在CSDN上挂了半天没个好答复。希望这里能帮我解决问题
搜索更多相关主题的帖子: servers 
2008-09-25 20:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-235183-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.219869 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved