ADODB-Abfragezeitlimit
Ich versuche, eine Abfrage zu öffnen, bei der eine Zeitüberschreitung auftritt. Ich habe versucht, die Timeout-Eigenschaft festzulegen, aber sie scheint sie nicht zu akzeptieren.
Die Abfrage dauert 34 Sekunden, um mithilfe des MS-SQL Server-Verwaltungsfensters (SQL Server 2005) ausgeführt zu werden, sodass ich weiß, dass das Timeout erhöht werden muss.
Aktueller Code:
Public Function retRecordSet(StrSQL)
Dim cmd ' as new ADODB.Command
Dim rs 'As New ADODB.Recordset
Set cmd = CreateObject("ADODB.Command")
Set rs = CreateObject("ADODB.Recordset")
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = StrSQL
cmd.CommandTimeout = 0
Set rs = cmd.Execute
Set retRecordSet = rs
End Function
Ich habe auch versucht, das Timeout der Verbindung selbst einzustellenCurrentProject.Connection.CommandTimeout = 120
, aber wenn ich den Wert direkt nach diesem Befehl abfrage, bleibt er bei 30
Verbindungseigenschaften:
Provider = Microsoft.Access.OLEDB.10.0; Persist Security Info = False; Datenquelle = MyServer; Integrated Security = SSPI; Initial Catalog = MyDatabase; Data Provider = SQLOLEDB.1
Data Source Object Threading Model = 1
Multiple Results = 3
Multiple Parameter Sets = False
SQL Support = 283
Catalog Location = 1
Catalog Term = database
Catalog Usage = 15
Rowset Conversions on Command = True
Extended Properties =
Cache Authentication = True
Encrypt Password =
Persist Encrypted =
Persist Security Info = False
Asynchronous Processing = 0
Connect Timeout = 600
Protection Level =
Prompt = 4
Mode =
Location =
Locale Identifier = 1033
Impersonation Level =
Window Handle =
Data Source = MyServer
User ID =
Password =
Integrated Security = SSPI
Mask Password =
Initial Catalog = MyDatabase
Lock Owner =
Bind Flags =
General Timeout = 0
Data Provider = SQLOLEDB.1
Autocommit Isolation Levels = 4096
Unique Reshape Names = False