I would like to open up to 10 databases read only and one more database to write the results. I need to access all databases at once, sum the values from each record, then write the results. I'm guessing I need to use slAttach. The 10 databases have one table each, all named "Habitat". I think that using the set number I can access each of the 10 databases using "slGetrow SetNum". How do I reference the database I want to write to on the last line without creating a new table in one of the other 10 databases?
B = Dir$(CombinePath$)
If Len(B) > 0 Then
SlOpen CombinePath$, "C"
For Y = 1 To NumRfiles
Afile$ = ReachPaths(Y) & ReachFiles(Y)
A = "D" & Using$("#",Y)
slSel "SELECT * FROM Habitat", Y 'With set number
If Y = 1 Then
ColumnNames = slGetTableColumnNames("Habitat")
Replace $Nul With "," In ColumnNames
slEXE "Create Table If Not Exists HabOut (" & ColumnNames & ")"
I guess I didn't need to use slAttach. I opened all 10 databases I wanted to read from did, a slSel for each database with a different set number. I opened the database I wanted to write to last. Using slGetRow requires a setnumber and so does slf().