Hi,
When clicking in a button i get the error -2147217900 (80040e14) "Invalid Sql Statement, expected 'DELETE','INSERT','PROCEDURE','SELECT' OR 'UPDATE'".
And it's triggered in the following line:
It's supposed to open a report, using a parameterized query. The parameter is provided by the text in the dbcombo.
I set the query in design mode and when i tested it , it worked fine.
I used the help from this page:
http://msdn.microsoft.com/en-us/libr...=vs.60%29.aspx.
I can't see what is wrong, because i've done this just like the above page.
MDIForm1.bd is the database i'm using.
Thanks in advance
When clicking in a button i get the error -2147217900 (80040e14) "Invalid Sql Statement, expected 'DELETE','INSERT','PROCEDURE','SELECT' OR 'UPDATE'".
And it's triggered in the following line:
Code:
DataEnvironment1.Command1_Grouping DBCombo1.Text
I set the query in design mode and when i tested it , it worked fine.
I used the help from this page:
http://msdn.microsoft.com/en-us/libr...=vs.60%29.aspx.
I can't see what is wrong, because i've done this just like the above page.
Code:
SELECT GERAL.NUM_REQ, GERAL.DATA_ENTRADA, GERAL.TIPO_REQ,
GERAL.NNIA, GERAL.QT_PEDIDA, GERAL.QT_FORNECIDA,
GERAL.DATA_FORNECIMENTO, GERAL.SERVICO, GERAL.NUM_SIG,
Identart.COA, Identart.DESC_ART, Identart.COD_UF, Identart.COD_DEP,
SERVIÇOS.NOME, SERVIÇOS.RESPONSÁVEL, GERAL.VALOR
FROM SERVIÇOS, GERAL, Identart
WHERE SERVIÇOS.`NUM_SERVIÇO` = GERAL.SERVICO AND
GERAL.NNIA = Identart.NNIA AND GERAL.SERVICO = ?
Code:
DataReport2.Orientation = rptOrientLandscape
With DataEnvironment1.Connection1
If .State = adStateOpen Then
.Close
End If
End With
DataEnvironment1.Connection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MDIForm1.bd & ";Persist Security Info=False"
DataEnvironment1.Connection1.Open
DataEnvironment1.Command1_Grouping DBCombo1.Text
DataReport2.Show
Thanks in advance