Here's my code for those who haven't seen it:
I get an error message on my SELECT statement saying:VB Code:
Option Explicit Private cn As ADODB.Connection Private rs As ADODB.Recordset Private Sub Form_Load() Set cn = New ADODB.Connection cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source= C:\mydatabase.mdb" cn.Open Set rs = New ADODB.Recordset rs.Open "SELECT * FROM game WHERE hometeamid = '" & Text1.Text & "' OR awayteamid = '" & Text1.Text & "'" rs.MoveFirst Do Until rs.EOF = True Combo1.AddItem rs.Fields("gameid") rs.MoveNext Loop rs.MoveFirst End Sub
Anyone have an idea as to why? Am I doing something wrong when I open the recordset?Code:Run-time error '3709'; The connection cannot be used to perform this operation. It is either close or invalid in this context.




Reply With Quote