B
Biggles
I have some tables in one database i would like to reference from another. I
have used linked tables in the past, but I don't like the way this will lock
out other developers from using that database. I thought this should work,
but the list24.rowsource = rs1 line is choking on a mismatch error.
Dim art_db As String
Dim conn_art As ADODB.Connection
Dim ssql1 As String
Dim rs1 As ADODB.Recordset
art_db = "L:\COMMON\Audit Resource & Training (ART)\auditresource.mdb"
Set conn_art = New ADODB.Connection
conn_art.ConnectionString = "provider=microsoft.jet.oledb.4.0;data
source=" & "'" & art_db & "'"
conn_art.Open
Set rs1 = New ADODB.Recordset
ssql1 = "SELECT tblAuditorInformation.strLANID,
tblAuditorInformation.strFirstName, " & _
"tblAuditorInformation.strMiddleName,
tblAuditorInformation.strLastName " & _
"FROM tblAuditorInformation " & _
"WHERE (((tblAuditorInformation.strAuditGroup)='Professional
Practices Group') " & _
"AND ((tblAuditorInformation.dtmTerminationDate) Is Null))"
rs1.Open ssql1, conn_art
Me.List24.RowSource = rs1
conn_art.close
Set conn_art = Nothing
Basically, I want, when the form loads, to populate this combobox with
information I query from another database, but I don't want to use linked
tables to do it. I want to open the connection, get the information, keep
the information, and close the connection. Can that be done with minor
tweaking/correcting of what I have here.
have used linked tables in the past, but I don't like the way this will lock
out other developers from using that database. I thought this should work,
but the list24.rowsource = rs1 line is choking on a mismatch error.
Dim art_db As String
Dim conn_art As ADODB.Connection
Dim ssql1 As String
Dim rs1 As ADODB.Recordset
art_db = "L:\COMMON\Audit Resource & Training (ART)\auditresource.mdb"
Set conn_art = New ADODB.Connection
conn_art.ConnectionString = "provider=microsoft.jet.oledb.4.0;data
source=" & "'" & art_db & "'"
conn_art.Open
Set rs1 = New ADODB.Recordset
ssql1 = "SELECT tblAuditorInformation.strLANID,
tblAuditorInformation.strFirstName, " & _
"tblAuditorInformation.strMiddleName,
tblAuditorInformation.strLastName " & _
"FROM tblAuditorInformation " & _
"WHERE (((tblAuditorInformation.strAuditGroup)='Professional
Practices Group') " & _
"AND ((tblAuditorInformation.dtmTerminationDate) Is Null))"
rs1.Open ssql1, conn_art
Me.List24.RowSource = rs1
conn_art.close
Set conn_art = Nothing
Basically, I want, when the form loads, to populate this combobox with
information I query from another database, but I don't want to use linked
tables to do it. I want to open the connection, get the information, keep
the information, and close the connection. Can that be done with minor
tweaking/correcting of what I have here.