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!)
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!)