SQL de SPT a ADO ?

19/08/2004 - 16:50 por MauricioPulla B. | Informe spam
Hola.
Con SPT podira ejecutar multiples SQL contra el servidor y me devolvia
varios cursores como puedo hacer para que con una Ado me haga el mismo
trabajo?

SPT: SqlExec(nCnn, "Select * from categories where categoryId = 1; Select *
from employees where EmployeeId = 1; Select * from Orders where employeeid 1")
ADO: ?

Con el siguiente ejemplo donde se crean los Cursores, como los recupero?

oCnn = CreateObject("adodb.connection")
oCnn.ConnectionString ="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=Northwind;Data Source=ServerLocal"
oCnn.Open()
oCnn.CursorLocation = 3 && adUseClient
oCnn.Execute("Select * from categories where categoryId = 1; Select * from
employees where EmployeeId = 1; Select * from Orders where employeeid = 1")
oCnn.Close()

Windows 2000Pro, VFP 8.0 SP1
Maurcio Pulla.
Cuenca-Ecuador
 

Leer las respuestas

#1 dtto086
20/08/2004 - 16:41 | Informe spam
a ver si te srive:

mi_coneccion = createobject("adodb.connection")
mi_coneccion = "tu cadena connection string"
mi_coneccion.open

consulta1 = createobject("adodb.recordset")

consulta2 = createobject("adodb.recordset")

sentencia = createobject("adodb.command")

with sentencia
.CommandText = "Select * from tabla1"
.CommandType = 1
.ActiveConnection = mi_coneccion
endwith

consulta1.locktype = 3
consulta2.locktype = 3

consulta1 = sentencia.execute

sentencia.CommandText = "Select * from tabla2"

consulta2 = sentencia.execute



"MauricioPulla B." escribió en el mensaje
news:
Hola.
Con SPT podira ejecutar multiples SQL contra el servidor y me devolvia
varios cursores como puedo hacer para que con una Ado me haga el mismo
trabajo?

SPT: SqlExec(nCnn, "Select * from categories where categoryId = 1; Select


*
from employees where EmployeeId = 1; Select * from Orders where employeeid
1")
ADO: ?

Con el siguiente ejemplo donde se crean los Cursores, como los recupero?

oCnn = CreateObject("adodb.connection")
oCnn.ConnectionString ="Provider=SQLOLEDB.1;Integrated


Security=SSPI;Persist
Security Info=False;Initial Catalog=Northwind;Data Source=ServerLocal"
oCnn.Open()
oCnn.CursorLocation = 3 && adUseClient
oCnn.Execute("Select * from categories where categoryId = 1; Select * from
employees where EmployeeId = 1; Select * from Orders where employeeid 1")
oCnn.Close()

Windows 2000Pro, VFP 8.0 SP1
Maurcio Pulla.
Cuenca-Ecuador


Preguntas similares