Hi
Is it possibly to use a query created in Design View in Access in ADO?
I'm beginning to wonder if it's possible.
I know there are several alternatives though I'm specifically trying to use a design view query in ADO.
By using the command object I have placed a reference to the query in the .commandText property though this gives me an error: 'Invalid SQL Statetement; expected Delete, Insert, Procedure, Select or Update.
Is there a way of execting a Design View query using ADO. I've placed the very simple code below along with the project attached. It's attached to an event handling procedure.
Code:
Private Sub Combo2_AfterUpdate()
Dim rst As Recordset
Dim cmd As ADODB.Command
Dim qrtest As String
qrtest = "MyQuery"
Set rst = New ADODB.Recordset
Set cmd = New ADODB.Command
With cmd
.ActiveConnection = CurrentProject.Connection
.CommandText = qrtest
.CommandType = adCmdText
End With
Set rst = cmd.Execute
Me.Text0 = rst.Fields(1)
End Sub