Question Errore di runtime ‘3151’. ODBC connessione a ‘SQL ServerServerName’ non riuscita.

giuvel

New member
Local time
Today, 23:13
Joined
Mar 17, 2009
Messages
1
Hi,

I have a big problem with Access 2000 (i have the same problem with Office 2007).
My Application use VBA (Access) & VIsual Basic 6.

Database:
SQL Server 2000 or SQL Server 2005 with the last service pack.

Client Operating System:
Windows XP SP2 or SP3

Server Operating System:
Windows 2003 Server.

Data Access:
Microsoft DAO with linked table.

For 1 minute My Applicatyion works fine then:
Runtime Error ‘3151’. ODBC ‘SQL ServerServerName’ Connection Failed.

With Windows 2000 client works fine.
No Lan problem.


For examples:
Dim db As dao.Database
Dim qdRig As dao.QueryDef
Dim rsRig As dao.Recordset
Dim rsTes As dao.Recordset
Dim strsql As String

Set db = CodeDb

strsql = "SELECT * FROM EosVn_Documenti WHERE EosVn_dOCUMENTI.FCliFor = 'C'"

Set rsTes = db.OpenRecordset(strsql, dbOpenDynaset)

strsql = "PARAMETERS Parameter1 Text; " _
& "SELECT * FROM EosVN_dOCrIGHE where eosvn_docrighe.iddocumento = [Parameter1]"

Set qdRig = db.CreateQueryDef("", strsql)
qdRig.Parameters!Parameter1 = ""
Set rsRig = qdRig.OpenRecordset(dbOpenDynaset)


If Not rsTes.EOF Then
While Not rsTes.EOF

qdRig.Parameters!Parameter1 = rsTes!IDDocumento

rsRig.Requery qdRig
While Not rsRig.EOF
Debug.Print rsRig!IDDocumento
rsRig.MoveNext
Wend


rsTes.MoveNext
Wend
End If

The line code that return ODBC error is 'rsRig.Requery qdRig'.

Is there any setup on XP which cause timeout? or anything else?


Thank You
 
Last edited:

Users who are viewing this thread

Back
Top Bottom