hi. i followed your tutorial, but when i run the application and click the find button, there is no data displayed on the dbgrid. do you have any idea how to fix this? thanks.
The DBGrid should have a property in the object inspector (Data Source) which should be set to the Data Source on the data module which has been connected to the query (with the SQL)
Hi, I have a question, for example I create an application on my Pc, Pc name might be “Dell” this ado connection will add this pc name in connection string. And now if I want to run this application on other computer, I need source code, and again I have to establish ado connection according to new pc name. is it possible that it works for any pc without making any changes? Other way of doing this with code, but then problem is you cannot see any data in design time like you are seen in tables all the column and data.
@@MrLongITandCAT adoquery1.SQL.Add('Select * from dbo.client where dbo.client.id = 1'); this one is working, so using integer works fine, but using string is not
@@MrLongITandCAT thank you for replying, yes i tried that, the same error message, the same query work fine in sql server, when i use "text" in sql server the same error message appears so i guess that the problem must be the quotation marks!
Hi. We have a whole playlist of PAT TIPS that you can use (see link below). More TIP videos will be added this year. Go look at: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-5kqUQYiC5Sc.html
You must have some text in the SQL property for the SQL to run when the ado query is active or open. It's like changing a lightbulb. First switch it off, then change it, then switch it on. So for the ado query you first make it active := false ; //should be made false by default then you enter your SQL statement into the ado query's SQL property adoquery.SQL.Text := 'SELECT....' ; Then you "switch the query on" by setting active property to true. If you SQL is correct then the query will run.
Self Created DataModule?! What happens on larger scale projects? If for instance, you have 50 DataModules?? Will you be filling up memory with objects you might not even need on runtime? And why clearing the TStrings collection of TADOQuery object? var _dmMusic : TdmMusic := TdmMusic.Create(self); var dsQryMusicDataSource : TDataSource := TDataSource.Create(self); dsQryMusicDataSource.DataSet := _dmMusic.qryMusic; with _dmMusic do Begin if qryMusic.Active then qryMusic.Close; qryMusic.SQL.Text := 'Select * from Owners'; yourDBGrid.DataSource := dsQryMusicDataSource; qryMusic.Open; End; That's the code you seek for,, without having self-created DataModules and objects in your entire project with significantly less memory footprint.
DataBase Firebird SQL ; if ch_AramaOpsiyon.Checked = False then sAra := QuotedStr ( UpperCase ( eAra.Text+'%') ) else sAra := QuotedStr ( UpperCase ( '%'+eAra.Text+'%') ); with dm.qryStokBaslik do begin Close; SQL.Clear; SQL.Add( 'SELECT * FROM T_CARI'); SQL.Add( 'WHERE CARI_ADI LIKE '+ sAra +' ORDER BY ...'); Open; end;