I am trying to create a program which will access a MySQL dbase, not only read data, I will need to manipulate data.
I have tried to find out how it works but found a problem. This is my code
Private Sub CmdExecuteQuery_Click() Dim sql As String sql = TxtQuery.Text Adodc1.CommandType = adCmdText Adodc1.RecordSource = sql Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 End Sub
On the form I have a ADODC object and a DataGrid.
The variable sql holds the query, whe I execute a SELECT query - NO PROBLEM. When I execute a INSERT query I will get the message "Operation is not allowed when the object is closed" on the line "Adodc1.Refresh" but the query will be executed. What am I doing wrong???
This post has been edited by jurasekpeter: 15 March 2009 - 11:31 AM

New Topic/Question
Reply



MultiQuote






|