提示出错
实时错误 '-2147467259 (80004005)'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server不存在或拒绝访问.
代码为:
Public FileName As String
Public BooksCallByTitle As Boolean
Public TotalIssueBook As Integer
Public RenewalCounter As Integer
Public MaxFineBal As Integer
Public MembershipDuration As Integer
Public MembershipFee As Integer
Public RenewalFees As Integer
Public strConnection As String
Public Sub LoadGlobalVariables()
Dim db As Connection
Dim adoprimaryrs As Recordset
Set db = New Connection
db.CursorLocation = adUseClient
db.Open strConnection 提示此行
Set adoprimaryrs = New Recordset
adoprimaryrs.Open "select TotalIssueBooks,RenewalCounter,MaxFineBal, MembershipDuration, MembershipFee, RenewalFees from GlobalVariables ", db, adOpenStatic, adLockOptimistic
TotalIssueBook = adoprimaryrs.Fields(0)
RenewalCounter = adoprimaryrs.Fields(1)
MaxFineBal = adoprimaryrs.Fields(2)
MembershipDuration = adoprimaryrs.Fields(3)
MembershipFee = adoprimaryrs.Fields(4)
RenewalFees = adoprimaryrs.Fields(5)
db.Close
End Sub