I wrote the following code:
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=MS Access Database;DBQ=K:\Registro de Planos\SRP
(SISTEMA REGISTRACION DE PLANOS)FINAL.mdb;DefaultDir=K:\Registro de
Planos;" _
), Array( _
"DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;;UID=admin;")), _
Destination:=Range("a2"))
.CommandText = Array( _
some stuff here
"FROM `K:\Registro de Planos\SRP(SISTEMA REGISTRACION DE PLANOS)
FINAL`.`00_PLANOS_V` `00_PLANOS_V`" & Chr(13) & "" & Chr(10) & "WHERE
`00_PLANOS_V`.OBRA = 'numobra'))" & Chr(13) & "" & Chr(10) & "ORDER
BY `00_PLANOS_V`.ID")
Some struff here
End With
End Sub
I need to include some code to ask me for a string varible
called "numobra", a then the query table must retrieve all the data
coincident with the string "numobra". See where statement.