Hi
can anybody tell me how to access the sql reply from an adodataset when there is no reply set. I am passing the sql string to adodataset which is attached to a datasource and in turn to a dbgrid. This is fine if the sql returns a reply set but if the reply is a record count from an insert or update for example, then how can I get this reply.
Thanks
V
Sql Reply From Adodataset Command
Page 1 of 13 Replies - 2603 Views - Last Post: 05 March 2005 - 08:02 AM
Replies To: Sql Reply From Adodataset Command
#2
Re: Sql Reply From Adodataset Command
Posted 05 March 2005 - 02:07 AM
Dim sql As String 'define SQL query sql = Text1.Text 'specify format of SQL result and assisgn to ADODC Adodc1.CommandType = adCmdText Adodc1.RecordSource = sql Adodc1.Refresh DataGrid1.Refresh 'Display result in the datagrid object Set DataGrid1.DataSource = Adodc1
See if this helps...I written many in VB...if the code doesnt help...let me know...I'll attach the full form then...
#3
Re: Sql Reply From Adodataset Command
Posted 05 March 2005 - 06:49 AM
many thanks for the reply born2code
The code you posted is much the same as I have and it works fine when the query returns a result set. But when the jet system just wants to return a message such as '10 records updated' from a DDL command I cant access it. It is these messages I want to get hold of.
[try
lc_dm1.lc_adodset1.active := false;
lc_dm1.lc_adodset1.commandtext := memo1.text;
lc_dm1.lc_adodset1.active := true;
edit1.Text := inttostr(lc_dm1.lc_adodset1.RecordCount);
except
messagedlg('Invalid SQL statement!',mterror,[mbok],0);
end;]
thanks
V
The code you posted is much the same as I have and it works fine when the query returns a result set. But when the jet system just wants to return a message such as '10 records updated' from a DDL command I cant access it. It is these messages I want to get hold of.
[try
lc_dm1.lc_adodset1.active := false;
lc_dm1.lc_adodset1.commandtext := memo1.text;
lc_dm1.lc_adodset1.active := true;
edit1.Text := inttostr(lc_dm1.lc_adodset1.RecordCount);
except
messagedlg('Invalid SQL statement!',mterror,[mbok],0);
end;]
thanks
V
#4
Re: Sql Reply From Adodataset Command
Posted 05 March 2005 - 08:02 AM
Hmm...Never tried finding out such things...I'll test some code..and then get back to you...
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|