Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Alex Meyer   on Mar 14 In MS Office Category.

  
Question Answered By: Jenny Lopez   on Mar 14

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.

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Extract data from mdb Or get search suggestion and latest updates.


Tagged: