I have several free tables in 2 different directories. I want to create a recordset with a select statement that pulls data from all three tables. My question is: How do I do this with 2 different connections?
Here is some psuedo code of what I want to do(Sorry for the VB syntax):
Table1 is in \\Netserv3\Salessys\Sales directory
Table2 is in \\Netserv3\Salessys\Sales directory
Table3 is in \\Netserv3\Salessys\Sales\Data directory
Table4 is empty Recordset Object
oConn1 is connection to \\Netserv3\Salessys\Sales directory
oConn2 is Connection to \\Netserv3\Salessys\Sales\Data directory
oRs_Table1.Open "Table1", oConn1, adOpenStatic, adLockReadOnly, adCmdTable
oRs_Table2.Open "Table2", oConn1, adOpenStatic, adLockReadOnly, adcmdTable
oRs_Table3.Open "Table3", oConn2, adOpenStatic, adLockReadonly, adcmdTable
SqlString = "Select oRs_Table1('Cusno'), oRs_Table2('Addr1'), oRs_Table2('City'), oRs_Table2('State'), oRs_Table2('Zip'), oRs_Table3('TSales') Where oRs_Table1('Cusno') = oRs_Table2('Cusno') And oRs_Table2('Cusno') = oRs_Table3('Cusno') Order By Table1('Cusno')"
oRs_Table4.Open SqlString
Everytime I try to open oRs_Table4 with the sqlstring, I get an error stating I need to specify a valid connection. How do I do this without having to have all of the tables in one directory?
Tim Westmoreland
Software Engineer
Skyline Technologies, Inc.
"Upper classes are a nation's past; the middle class is its future." - Ayn Rand, Russian-born author (1905-1982).