JP
Jul 11th, 1999, 07:41 PM
I have a problem with getting column information using RDO2 and VB5. The two queries below bring back
different results in the debug window. The second query is correct whereas the first is incorrect.
I cannot understand why the first query is bringing back the wrong result into the debug window - the column
column1 in table2 is defiined as NOT NULL.
Can someone tell me the answer? Even though the second query works, I would prefer to use the syntax
in the first query in my app.
----------
Dim rsResult as rdoResultSet
Dim strSQL as string
/* Note: table1 has an index on column1, table2 has an index on column1
The columns in both tables were created with NOT NULL
Both queries will return only 1 row
*/
strSQL = "select a.column1, a.column2, b.column1 as 'Null_Allowed' " & _
"from table1 a left join table2 b on b.column1 = a.column1 " & _
"where a.column1 = 10056"
set rsResult = rdocn.OpenResultset (strSQL)
Debug.Print rsResult.rdoColumns("column1").Required
/* The result in the debug window for the above statement is 'True'. This is correct */
Debug.Print rsResult.rdoColumns("Nulls_Allowed").Required
/* The result in the debug window for the above statement is 'False'. This is incorrect */
rsResult.Close
strSQL = "select a.column1, a.column2, b.column1 as 'Null_Allowed' " & _
"from table1 a, table2 b " & _
"where a.column1 = 10056 and b.column1 = a.column1"
set rsResult = rdocn.OpenResultset (strSQL)
Debug.Print rsResult.rdoColumns("column1").Required
/* The result in the debug window for the above statement is 'True'. This is correct */
Debug.Print rsResult.rdoColumns("Nulls_Allowed").Required
/* The result in the debug window for the above statement is 'True'. This is correct */
rsResult.Close
----------
Any help appreciated.
Many thanks,
Jaimin Patel
Email: jaimin.patel@aon.co.uk
different results in the debug window. The second query is correct whereas the first is incorrect.
I cannot understand why the first query is bringing back the wrong result into the debug window - the column
column1 in table2 is defiined as NOT NULL.
Can someone tell me the answer? Even though the second query works, I would prefer to use the syntax
in the first query in my app.
----------
Dim rsResult as rdoResultSet
Dim strSQL as string
/* Note: table1 has an index on column1, table2 has an index on column1
The columns in both tables were created with NOT NULL
Both queries will return only 1 row
*/
strSQL = "select a.column1, a.column2, b.column1 as 'Null_Allowed' " & _
"from table1 a left join table2 b on b.column1 = a.column1 " & _
"where a.column1 = 10056"
set rsResult = rdocn.OpenResultset (strSQL)
Debug.Print rsResult.rdoColumns("column1").Required
/* The result in the debug window for the above statement is 'True'. This is correct */
Debug.Print rsResult.rdoColumns("Nulls_Allowed").Required
/* The result in the debug window for the above statement is 'False'. This is incorrect */
rsResult.Close
strSQL = "select a.column1, a.column2, b.column1 as 'Null_Allowed' " & _
"from table1 a, table2 b " & _
"where a.column1 = 10056 and b.column1 = a.column1"
set rsResult = rdocn.OpenResultset (strSQL)
Debug.Print rsResult.rdoColumns("column1").Required
/* The result in the debug window for the above statement is 'True'. This is correct */
Debug.Print rsResult.rdoColumns("Nulls_Allowed").Required
/* The result in the debug window for the above statement is 'True'. This is correct */
rsResult.Close
----------
Any help appreciated.
Many thanks,
Jaimin Patel
Email: jaimin.patel@aon.co.uk