B
BCP
I have a somewhat unsual problem. I am creating a passthrough query to hit
DB2 table with Access. The problem is DB2 is a little sensitive to
punctuation. I was able to create the paathrough query just fine with the
following code. The problem is the query fails because Access addes Brackets
around the first node in the tables in the from clause, "[TBDW1].
Any ideas of how to turn this off.
SQL = "SELECT " & _
"CONF_TEST_ORD_D.TEST_ORD_NUM, " & _
"LBTR_LAB_SPEC_D.SPECIMEN_NUMBER, " & _
"LBTR_TEST_RSLTS_F.ORDER_DT_SRGT " & _
"FROM TBDW1.LBTR_TEST_RSLTS_F LBTR_TEST_RSLTS_F, " & _
"TBDW1.LBTR_LAB_SPEC_D LBTR_LAB_SPEC_D, " & _
"TBDW1.CONF_TEST_ORD_D CONF_TEST_ORD_D " & _
"Where LBTR_TEST_RSLTS_F.SPECIMEN_SRGT =
LBTR_LAB_SPEC_D.SPECIMEN_SRGT And " & _
"LBTR_TEST_RSLTS_F.TEST_ORD_SRGT =
CONF_TEST_ORD_D.TEST_ORD_SRGT And " & _
" (CONF_TEST_ORD_D.TEST_ORD_NUM Between '" & O1 & "' And '" & Or2 & "')
And" & _
" (LBTR_TEST_RSLTS_F.ORDER_DT_SRGT Between " & D1 & " And " & D2 & ");"
QN = "TmpTestQry"
Set QDF = db.CreateQueryDef(QN, SQL)
QDF.Connect = "ODBC;DSN=@;UID=@;PWD=@;MODE=SHARE;DBALIAS=@;"
@ - Names were changed to protect the innocent.
DB2 table with Access. The problem is DB2 is a little sensitive to
punctuation. I was able to create the paathrough query just fine with the
following code. The problem is the query fails because Access addes Brackets
around the first node in the tables in the from clause, "[TBDW1].
Any ideas of how to turn this off.
SQL = "SELECT " & _
"CONF_TEST_ORD_D.TEST_ORD_NUM, " & _
"LBTR_LAB_SPEC_D.SPECIMEN_NUMBER, " & _
"LBTR_TEST_RSLTS_F.ORDER_DT_SRGT " & _
"FROM TBDW1.LBTR_TEST_RSLTS_F LBTR_TEST_RSLTS_F, " & _
"TBDW1.LBTR_LAB_SPEC_D LBTR_LAB_SPEC_D, " & _
"TBDW1.CONF_TEST_ORD_D CONF_TEST_ORD_D " & _
"Where LBTR_TEST_RSLTS_F.SPECIMEN_SRGT =
LBTR_LAB_SPEC_D.SPECIMEN_SRGT And " & _
"LBTR_TEST_RSLTS_F.TEST_ORD_SRGT =
CONF_TEST_ORD_D.TEST_ORD_SRGT And " & _
" (CONF_TEST_ORD_D.TEST_ORD_NUM Between '" & O1 & "' And '" & Or2 & "')
And" & _
" (LBTR_TEST_RSLTS_F.ORDER_DT_SRGT Between " & D1 & " And " & D2 & ");"
QN = "TmpTestQry"
Set QDF = db.CreateQueryDef(QN, SQL)
QDF.Connect = "ODBC;DSN=@;UID=@;PWD=@;MODE=SHARE;DBALIAS=@;"
@ - Names were changed to protect the innocent.