lmonaghan
Board Regular
- Joined
- Nov 27, 2004
- Messages
- 84
I have created several pass through queries in Access, but I would like to execute one in VBA because I want to create a dynamic SQL string. I am using Access 2007.
Here is the existing SQL I am using in my pass through query (Oracle 11g):
SELECT ticket_id, short_code FROM vw_billing_transaction WHERE ticket_id IN ('21089-0215K-1708C-03WG1','2108C-02113-2004Q-02YTD','2108A-0211H-19576-03PQ7','21081-0215K-17407-03JJM');
Here is my connection string:
ODBC;DSN=OMPUBLIC;UID=OMPUBLIC;PWD=ompublic;DBQ=PROD ;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;
<B>So first and foremost, I would love to know how to execute that in VBA in MS Access.</B>
Secondly, I would like that SQL string to be dynamic based on the results from another query within my database. I have a table that contains the complete list of ticket_ids I need to look up in the Oracle database. Is there a way to pass in that list in the SQL statement above?
Here is the query to generate the list of ticket_ids needed:
SELECT qryUSCellularRefundsInterim.[Partner Transaction ID] AS ticket_id
FROM qryUSCellularRefundsInterim;
Thanks in advance for any help.
Here is the existing SQL I am using in my pass through query (Oracle 11g):
SELECT ticket_id, short_code FROM vw_billing_transaction WHERE ticket_id IN ('21089-0215K-1708C-03WG1','2108C-02113-2004Q-02YTD','2108A-0211H-19576-03PQ7','21081-0215K-17407-03JJM');
Here is my connection string:
ODBC;DSN=OMPUBLIC;UID=OMPUBLIC;PWD=ompublic;DBQ=PROD ;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;
<B>So first and foremost, I would love to know how to execute that in VBA in MS Access.</B>
Secondly, I would like that SQL string to be dynamic based on the results from another query within my database. I have a table that contains the complete list of ticket_ids I need to look up in the Oracle database. Is there a way to pass in that list in the SQL statement above?
Here is the query to generate the list of ticket_ids needed:
SELECT qryUSCellularRefundsInterim.[Partner Transaction ID] AS ticket_id
FROM qryUSCellularRefundsInterim;
Thanks in advance for any help.