tatendatiffany
Board Regular
- Joined
- Mar 27, 2011
- Messages
- 103
Is there a way of adding multiple sql queries in the same record or do i have to do separate recordsets each time i have a new query: the area in bold is my attempt to add another query am i on the right path or i am missing some important parameters
HTML:
Dim rs As ADODB.RecordsetDim cn As ADODB.ConnectionDim strSQL1 As StringstrSQL1 = "SELECT COUNT (INUNACPT) FROM AIS3.QM4.KTPT80T WHERE CDPRODCO=RETAIL_MAP"str2SQL2="SELECT COUNT (INACCEPT) FROM AIS3.KTPT81T WHERE CDRPODCO=RETAIL_MAP"Set rs = New ADODB.RecordsetSet cn = New ADODB.Connectioncn.Open CONNECTION_STRING '//You must provide a connection string herers.Open strSQL1, cnrs.Open strSQL2,cnrs.CopyFromRecordset Index.Range("AC2")rs.CopyRecordset Index.Range ("AC3")rs.Closecn.Close