Conexion to SQL Server Express 2008 very slow

  • Thread starter José A. Giménez [Py]
  • Start date
J

José A. Giménez [Py]

Hello, i have an Access 2007 aplication, i need to read data from a table
in sql server and show it in a form. I use this code from conexion:

Dim rst As New ADODB.Recordset
Dim con As New ADODB.connection
con.ConnectionString = "Provider=SQLNCLI10;" _
& "Server=SQLSERVER\SQLEXPRESS;" _
& "Database=Datos Upisa;" _
& "Integrated Security=SSPI;" _
& "DataTypeCompatibility=80;" _
& "MARS Connection=True;"
con.Open

Set rst.ActiveConnection = con
rst.Source = "SELECT * FROM Bancos where NomBanco='" & Me.ElBanco & "'"
Me.LaDirec = rst.Fields("Direccion").Value

The conexion is very slow... almost 1 second for one record (the table have
only one record)
I try with
cnn.Open "Provider=SQLOLEDB; " & _
"Initial Catalog=Datos Upisa; " & _
"Data Source=SQLSERVER\SQLEXPRESS; " & _
"integrated security=SSPI; persist security info=True;"

but is slow too.
When the SQL Server Management Studio is open, the process is fast, but its
close, the process is very slow again

What's wrong?
(I need use without linked tables.)

(Sorry for my english!)
 
S

Sylvain Lafontaine

Are you sure that the database is not set in Auto-close mode?

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
S

Sylvain Lafontaine

Set it to False and see if this will correct the problem or not.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top