I'm trying to use ADO in access to lookup product info from a few tables. The table to use depends on the choices the user selects in three combo boxes. I just can't get it to connect to any of the tables with my code:
Expand|Select|Wrap|Line Numbers
- Private Sub PopulateGrade()
- Dim cnn1 As ADODB.Connection
- Dim GdRs As New ADODB.Connection
- Dim SQLst As String
- Set cnn1 = CurrentProject.Connection
- SQLst = "SELECT Product, Flute FROM "
- SQLst = SQLst & ComboMill.Value & ComboBoard.Value
- SQLst = SQLst & " WHERE (((Flute)='"
- SQLst = SQLst & ComboFlute.Value & "'"
- GdRs.Open SQLst
- End sub
When I run the code I get:
Run-Time Error '-2147467259(80004005)':
[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified.
I need to know if it's looking for the data source in the right place as the name should be correct and what's a default driver and how do you specify one.
Any help you can offer is most welcome as this is driving me nutts
Many thanks
Dave