|
Hi All,
I have a access database.
Whenever we open the database the date and time of the
database file will be changed.
If the user has modified the database ( any table updation )
then only the date and time of the file to be changed?
How to do this?
|
|
|
|
|
Why would you want to do this? As Access stores the data on disk, it has to abide by the operating system rules on file modifications. If you need to check the date for datas sake, then this information should be on the tables themselves. In other words, you should supply created/changed fields which store the details of the time the data item was created/updated.
|
|
|
|
|
OK .
How to get the date and time information
of the table through ADO programming.
I want to know when the date and time of the table is modified.
|
|
|
|
|
Did I not mention that they would be columns on the table? Just query that information.
|
|
|
|
|
If you open a table in an Access database, even if all you do is open it and never run a select query or anything, then Access modifies the mdb file, so the file timestamp will change. That is the way Access works, and there is nothing you can do about it.
As someone else has already pointed out, if you need to know when the data was last updated then you should build it in to your application in one way or another.
|
|
|
|
|
I'm not sure how you would get table modifications, however getting RECORD modifications is a VERY simple excercise, you do have a number of options. ALL of them require additional columns/fields to be added to the tables you want to monitor.
We monitor all tables so we have a Modified and ModifiedBy on all tables.
Add a timestamp field to the table and trigger it every time a record is saved, I think you can trigger this in access, not sure anymore.
From your UI pass in the userid and datetime whenever you write back to the database.
In your update/insert query automatically gather the current user and the datetime and add then to the update/save
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi
I am comparing data between 2 tables looking for what exists in one so i can then enter whatis found into the second table as follows...
<pre>
mysql_select_db($database_Chartmenu, $Chartmenu);
$query_find_all = "SELECT hankypark.ID FROM hankypark LEFT JOIN tbl_ply_hankypark ON hankypark.ID = tbl_ply_hankypark.Song_ID WHERE (((tbl_ply_hankypark.Song_ID) Is Null))";
$find_all = mysql_query($query_find_all, $Chartmenu) or die(mysql_error());
$row_find_all = mysql_fetch_assoc($find_all);
$totalRows_find_all = mysql_num_rows($find_all);
</pre>
in the hankypark table i know will be entries that do not exist in the tbl_ply_hankypark table hense the Is Null query which gives me an array of the ID field, I now want to add those ID's to the tbl_ply_hankypark table. Question is what do I use to roll through all the ID's found ?
My INSERT query looks like this...as said what do use tat the begining is it a...
while or do or what?? and how should it be properly laid out please? not having played with arrays I have tried several things from suggestions on the net but none seem to work apart from one that only inserted the first ID and then stopped?
<code>
// Insert a row of information into the table "example"
mysql_query("INSERT INTO tbl_ply_hankypark (Song_ID) VALUES ('???')")or die(mysql_error());
</code>
Thought it best to just bite the bullet and come ask you guys cos your always right lol
Cheers in advance of any help
Regards
Ray
|
|
|
|
|
Look into using an INSERT/SELECT statement.
|
|
|
|
|
One thing that you can do is combine an insert and a select command together, so you actually get the values inserted that you select from the select query. Your command becomes something like this:
INSERT INTO tbl_ply_hankypark(song_id)
SELECT hankypark.ID FROM hankypark
LEFT JOIN tbl_ply_hankypark ON
hankypark.ID = tbl_ply_hankypark.Song_ID
WHERE (((tbl_ply_hankypark.Song_ID) Is Null))
|
|
|
|
|
Thnak you for both replies I knew I would get the right directions here
Many Thanks for you help
Regards
Ray
|
|
|
|
|
|
Thanks in Advance
Can some one suggest me , any Good eBook for Oracle 11g
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
modified on Wednesday, October 6, 2010 6:32 AM
|
|
|
|
|
Oracle 11g is a massive beast. You need to clarify what you are looking for here - programming? DBA?
|
|
|
|
|
Thanks for the reply " Programming "
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
|
|
|
|
|
There's an ebook for this[^] one. The printed copy is excellent (I never buy ebooks, I prefer paper copy).
|
|
|
|
|
Isn't that fairly new, I be astonished if there were many books published yet.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Actually there are some but i want any recommendation/Suggestion
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
|
|
|
|
|
Hi.
I have a problem with an xml.
I don't know how to read a piece o an xml.
This is the xml:
<root IDUtilizator="1" IDFormular="210">
<Forma R1="2" NumeCamp0="Numar" R2="20101006" NumeCamp1="Data" R3="2040" NumeCamp2="NrRegistratura" R4="20101006" NumeCamp3="DataRegistratura" R5="20100301" NumeCamp4="De la" R6="20101006" NumeCamp5="Pana la" R7="0" NumeCamp6="Data de referinta" R8="0" NumeCamp7="Tip persoana" R9="1000125" NumeCamp8="Tip taxa" R10="0" NumeCamp9="Utilizator" R11="0" NumeCamp10="Insolventi" R12="0" NumeCamp11="Sortare dupa" DataMod="20101006" />;
<Selectat Col1="PF-Da-Taxa apa apometru" />
<Parametrii Sir="Optiuni selectie: Numar=2 Data=20101006 NrRegistratura=2040 DataRegistratura=20101006 De la=20100301 Pana la=20101006 Data de referinta=Data document Tip persoana=PF/PJ Tip taxa=Cu debit Insolventi=Nu Sortare dupa=conturi bugetare " />
I don't know how to get the information from the Parametrii Sir.
Maybe you have an idea.
thanks
|
|
|
|
|
Can you please advicing a very Good artical on Query optimization techniques SQL server database. currently my DB performance is very very slow. Pleaes advice.
Thanks in advance
|
|
|
|
|
|
|
|
|
you're welcome.
|
|
|
|
|
Here's what I'm trying to do, using C#:
1 - Connect to SQL Server
2 - Check if a database is present.
3 - Create the database if it isn't.
4 - Create a login/user pair for that database.
5 - Store the connection string for future use.
I have this done, confirmed by using SQL Server Management Studio Express.
The following method throws an SqlException:
private static SqlDataReader executeQuery(String query) {
SqlCommand command = new SqlCommand(query, Connection);
SqlDataReader reader;
try {
openConnection();
reader = command.ExecuteReader();
return reader;
} catch {
throw;
} finally {
}
}
The query: SELECT ReportGroupName FROM dbo.ReportGroups
The error message: Invalid object name 'dbo.ReportGroups'.
The offending line of code: reader = command.ExecuteReader();
Some lines from the script I used to create the database, tables and user:
CREATE LOGIN [bim] WITH PASSWORD=N'*******', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
EXEC sys.sp_addsrvrolemember @loginame = N'bim', @rolename = N'dbcreator'
CREATE USER [bim] FOR LOGIN [bim] WITH DEFAULT_SCHEMA=[dbo]
CREATE TABLE [dbo].[ReportGroups]
I have a feeling that the problem lies with how I setup the default user, since I'm still learning databases, and it's been pretty hit or miss. However, the application worked previously using the above method with the same query string - the exception has only occurred recently, after creating the database from a script rather than in using the visual editors in SQL Server Management Studio. The script I used to create the database was derived from exports of the original database and tables, with only modifications made to create a login and a user.
Any assistance on tracking down how to fix this error would be greatly appreciated.
|
|
|
|