documentation, pointers on TMyTable.Open in MyDAC - mysql

I am learning Devart's mydac Data Access Components and I have few question I have not been able to resolve through online searches and the documentations. In the code examples, I see invocation of TMyTable.Open but I could not find the description in TMyTable class or its inheritance path. I would like to as if anyone can point me to the documentation of this method and whether it has any relationship to TDBGrid class.
Thanks in advance

TDataSet.Open is generally used to get a data cursor back from the database.
In order to use a TDBGrid you need to connect it to the TDataSet (In your case a TMyTable) through a TDataSource.
On the other hand TMyTable.Execute will only run your SQL code on the server and not retrieve any data (except for some info on the affected rows).
You normally use Execute for INSERT, DELETE, UPDATE, etc and Open for SELECT statements.

In my case, a F1 keystroke while the caret is over a SQLQuery1.Open; brings the help in the DB.TDataSet.Open article, which in turn gave me a (broken) link to the current DocWiki Page. Far from perfect, but good enough to get basic information.
http://docwiki.embarcadero.com/VCL/en/DB.TDataSet.Open

Related

Can I use MySql with SignalR?

Goodmorning,
is there anyone that has already developed something about how to insert, update or select chat conversation in asp.net with MySql database?
I found SqlDependency class open source, then MySqlDependency that is like 100$ each year.
Still nothing open source for Mysql db?
I tried to develop something, my idea was just, insert or update the db when the client leave or change the page but there is nothing about event on change url domain with javascript.
I never thought that it could be so difficult to develop a chat.
Can some good people help posting some code about this?
Thank you very much
it's actually very easy if you get the concept. you can check the video from here: https://www.youtube.com/watch?v=8Fxm_54j-h8 and also you can find the code in the description.
although it's written on Entity Framework core with SQL server provider. you can just change the provider for MySQL and it'll work.

How to Get Rid of UNUSED Queries in MS ACCESS

I have reviewed the previous Questions and haven't found the answer to the following question,
Is there a Database Tool available in MS Access to run and identify the Queries that are NOT Bring used as a part of my database. We have lots of Queries that are no longer used and I need to clean the database and get rid of these Queries.
Access does have a built in “dependency” feature. The result is a VERY nice tree-view of those dependencies, and you can even launch such objects using that treeview of your application to “navigate” the application so to speak.
The option is found under database tools and is appropriately called Object Dependencies.
The result looks like this:
While you don't want to use auto correct, this feature will force on track changes. If this is a large application, then on first run a significant delay will occur. After that, the results can be viewed instantly. So, most developers still turn off track name autocorrect (often referred to track auto destroy). However, the track auto correct is required for this feature.
And, unfortunately, you have to go query by query, but at least it will display dependences for each query - (forms, or reports). However, VBA code that creates SQL on the fly and uses such queries? Well, it will not catch that case. So, at the end of the day, deleting a query may well still be used in code, and if that code creates SQL on the fly (as at LOT of VBA code does, then you can never really be sure that the query is not not used some place in the application.
So, the dependency checker can easy determine if another query, another form/sub form, or report uses that query. So dependency checker does a rather nice job.
However, VBA code is a different matter, and how VBA code runs and does things cannot be determined until such time code is actually run. In effect, a dependency checker would have to actually run the VBA code, and even then, sometimes code will make several choices as to which query to run, or use - and that is determined by code. I suppose that you could do a quick "search", since a search is global for VBA (all code in modules, reports and forms can be searched). This would find most uses of the query, but not in all cases since as noted VBA code often can and does create sql on the fly.
I have a vague recollection part of Access Analyzer from FMS Inc has this functionality built in.
Failing that, I can see 2 options that may work.
Firstly, you could use the inbuilt Database Documenter. This creates a report that you can export to Excel. You would then need to import this into the database, and write some code that loops the queries to see if they appear in this table;
Alternatively, you could use the undocumented "SaveAsText" feature to loop all Forms/Reports/Macros/Modules in your database, as well as looping the Querydefs and saving their SQL into a text file. You would then write some VBA to loop the queries, open each of the text files and check for the existence of the query.
Either way, rather than just deleting any unused queries, rename then to something like "old_Query", and leave them for a month or so in the database just in case!!
Regards,

MySQL Alternative to Trigger on Select

For a project I am currently working on, I am required to use triggers to restrict users' access to a database. However, since there are no triggers on SELECT statements, I need to find some alternative method for adding restrictions before a SELECT statement is executed. Are there any alternatives to "Triggers on SELECT"? if so, what are they?
Note: This is an assignment, thus I cannot add the restrictions at application level since the point of the assignment is to add restrictions at the DB Level.
I have also read all other posts that I can find on this, please don't close this post pointing me to some other related posts unless they have several alternatives I can choose from. I'm not saying these posts are of no use or the solutions are not proper, However, I would like to explore all of the possible solutions.
One solution is to change the table to a view, such that querying the view invokes a stored function, and the stored function logs access to the table.
Here's a blog by the great Roland Bouman, describing the process in detail:
http://rpbouman.blogspot.com/2005/08/mysql-create-dirty-little-tricker-for.html

Is there a Magento debug tool that lets me see database queries displayed in a similar manner to template path hints?

I have some corrupted data, an individual entry, in the database for my Magento installation. Since I can see the corrupted data displaying, I'd like to use a Magento extension to show me the database call displaying that data onscreen. Does such a tool exist? If not, what would be the best tool for SQL to gather this information?
You can see the SQL statement used to load a collection by using $collection->getSelect(). You'd have to narrow down the collection call first though, which might not be much help in your case.
http://blogs.ifuelinteractive.com/2009/10/18/logging-all-sql-in-magento/

Is it possible to get the user who last edited a stored proc, function, table or view in SQL Server?

I'm not even sure SQL Server stores this kind of information, but, is it possible to get the username of the person who last modified a particular stored procedure, function, table or view?
Nothing critical, just wondering. Thanks!
If you are using SQL Server 2008, you could use some new features that allow you to put triggers on DDL changes. You can then track, based on the authenticated user, who made the change.
I think these triggers are new to SQL 2008, but they may be available in 2005.
Having said this, ideally you should have your database schema under source control, using a tool like Visual Studio Database Professional. Then you'd have a complete history of who did what and when.
Randy
It doesn't store this information out of the box.
You can use SQL Trace and Event notification (see the corresponding MSDN Article) to log this kind of information by yourself.
I have no experience with these technologies though ...
Definitely put DDL triggers in place. Even if you don't end up using them, or if you end up putting a decent source control system in place, still have the DDL triggers in place so that you can be sure about what's going on.