For Adodc1, in the properties window:
CommandType = 1 - adCmdText
Select ConnectionString and click the button that appears. Select the "Use connection string" option and click the build button. Browse to your database path and click the "Test Connection" button and make sure it succeeds. If not, it's a bad path or the drive the database is on is down (server?). Press Ok, then Apply on the origional form. Select the recordsourse tab, make sure the combo box says 1 - adCmdText, and type in your sql statement in the bottom textbox. That's hard coded, so if u need to change the sql statement at runtime, this is how I do it:
Const DBProvider as String = "Provider=Microsoft.Jet.
OLEDB.4.0;PersistSecurity Info=False"
Const DBPath as String = "C:\MyDatabasePath\MyDatabase.mdb"
dim strSQL as String
strSQL = "SELECT * FROM tblMyTable WHERE MyField = '" & txtCriteria.Text & "'"
Adodc1.Recordset.Close 'error here if already closed
Adodc1.Recordset.Open strSQL, DBProvider & DBPath
Set DataList1.DataSource = Adodc1
Hope that helps!
-Mike
DataSource=\\wcgoktulf153\tul1drftpln\MDB15sl\siteinfo.mdb; Difference between a madman and a genius:
A madman uses his genius destructively,
A genius uses his madness constructively.