H
Heapy
I'm creating some recordsets where the source is an SQL statement.
For some reason, the OpenRecordset method is truncating the SQL Statement to
the first 256 characters of the variable that holds the statement (i.e. the
length of the string might be 600 characters, but only the first 256 make it
into the OpenRecordset).
Any ideas what I'm doing wrong.
e.g.
SQLBilling = "SELECT BILLING_TXNS.TXN_DATE, CONSULTANTS.CONS_NM,
BILLING_TXNS.UTIL_IND, BILLING_TXNS.CHARGE_IND, BILLING_TXNS.PROJECT_ID,
BILLING_TXNS.TOT_HOURS, BILLING_TXNS.BILLING_STATUS,
CONS_RATES.CONS_DEF_RATE, BILLING_TXNS.CONS_ACT_RATE"
SQLBilling = SQLBilling & " FROM (CONS_RATES INNER JOIN CONSULTANTS ON
CONS_RATES.CONS_LVL = CONSULTANTS.CONS_LVL) INNER JOIN BILLING_TXNS ON
CONSULTANTS.CONS_ID = BILLING_TXNS.CONS_ID"
SQLBilling = SQLBilling & " WHERE (((BILLING_TXNS.TXN_DATE)>=" & Date1 & "
And (BILLING_TXNS.TXN_DATE)<=" & Date2 & "));"
Set rstBil1 = CurrentDb.OpenRecordset(SQLBilling, dbOpenDynaset, dbReadOnly)
The SQLBilling variable is defined as a string, and does report the correct
SQL statement when printed, but only the first 256 characters make it into
the recordset.
Thx for any help,
HWH
For some reason, the OpenRecordset method is truncating the SQL Statement to
the first 256 characters of the variable that holds the statement (i.e. the
length of the string might be 600 characters, but only the first 256 make it
into the OpenRecordset).
Any ideas what I'm doing wrong.
e.g.
SQLBilling = "SELECT BILLING_TXNS.TXN_DATE, CONSULTANTS.CONS_NM,
BILLING_TXNS.UTIL_IND, BILLING_TXNS.CHARGE_IND, BILLING_TXNS.PROJECT_ID,
BILLING_TXNS.TOT_HOURS, BILLING_TXNS.BILLING_STATUS,
CONS_RATES.CONS_DEF_RATE, BILLING_TXNS.CONS_ACT_RATE"
SQLBilling = SQLBilling & " FROM (CONS_RATES INNER JOIN CONSULTANTS ON
CONS_RATES.CONS_LVL = CONSULTANTS.CONS_LVL) INNER JOIN BILLING_TXNS ON
CONSULTANTS.CONS_ID = BILLING_TXNS.CONS_ID"
SQLBilling = SQLBilling & " WHERE (((BILLING_TXNS.TXN_DATE)>=" & Date1 & "
And (BILLING_TXNS.TXN_DATE)<=" & Date2 & "));"
Set rstBil1 = CurrentDb.OpenRecordset(SQLBilling, dbOpenDynaset, dbReadOnly)
The SQLBilling variable is defined as a string, and does report the correct
SQL statement when printed, but only the first 256 characters make it into
the recordset.
Thx for any help,
HWH