473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Auto Perging data

Zerin
64
To all,

Best regards.I submitted this problem about auto purge a database many days ago but there's no reply till now.If anyone has any solution,please reply as soon as possible.

Is aouto purging possible in Visual Basic 2005 Express? How can I do it or get related codes?

Your help will be greatly honoured.

Zerin
Dec 13 '06 #1
4 1234
Killer42
8,435 Expert 8TB
Best regards.I submitted this problem about auto purge a database many days ago but there's no reply till now.If anyone has any solution,please reply as soon as possible.

Is aouto purging possible in Visual Basic 2005 Express? How can I do it or get related codes?
Um... can you please explain what you mean by "auto-perging"? (By the way, in English at least, it's more likely to be "purging" than "perging".
Dec 15 '06 #2
Zerin
64
Um... can you please explain what you mean by "auto-perging"? (By the way, in English at least, it's more likely to be "purging" than "perging".
Killer42 my frnd !

I solved the problem on the front-end by VB 2005.I'm pasting the code sample here:

[PHP]Private Sub autoParge(ByVal oledbConn As OleDbConnection)
strSQL = " DELETE * FROM INSPECTION WHERE INT(Datediff('d',DATE,now()))>30 "
sqlCommand = New OleDbCommand(strSQL, oledbConn)
Try
oledbConn.Open()
sqlCommand.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
oledbConn.Close()
End Try

End Sub[/PHP]

Here, INSPECTION is a table of data,DATE is the time inserted in one column of the table (related to the data appearance in the table) and this module has to be called from where it should be.
Jan 15 '07 #3
Killer42
8,435 Expert 8TB
Hey, good to see you got it sorted out.

However, I'm sure you know by now that I hate to let anything go by without commenting. :) So, I do have a couple of questions/comments:
  • Is the Int( ) function necessary in the SQL string? I thought that DateDiff would already return an int. (I'm not telling you - just asking, as I'm too lazy to check).
  • I think that by using DATE as a field name you are setting yourself up for potential problems in the future. Because in MS Access the DATE (or DATE( )) function is the equivalent of VB's Now( ).
  • I just love the colour-coding produced by the PHP tags. I'm starting to think maybe I should use PHP instead of CODE to tag my code on TheScripts.
Jan 15 '07 #4
Zerin
64
Hey, good to see you got it sorted out.

However, I'm sure you know by now that I hate to let anything go by without commenting. :) So, I do have a couple of questions/comments:
  • Is the Int( ) function necessary in the SQL string? I thought that DateDiff would already return an int. (I'm not telling you - just asking, as I'm too lazy to check).
  • I think that by using DATE as a field name you are setting yourself up for potential problems in the future. Because in MS Access the DATE (or DATE( )) function is the equivalent of VB's Now( ).
  • I just love the colour-coding produced by the PHP tags. I'm starting to think maybe I should use PHP instead of CODE to tag my code on TheScripts.

Well,
  • As I'm new in VB,when the result of the line with DataDiff didn't work properly, I tried INT and then it worked out.So, I don't know.................actually.
  • And thanks for letting me know about the DATE() function.I don't want myself to be screwed up in future............so,I think I'll change it.
  • I just used the PHP tech today and it looks really nice.

Hey,can you prescribe me any tutorial that will help me developing myself faster in VB 2005 (with Access) ?

Actually I had been a Database guy,so in VB I seem to be lost myself.Please help.
Jan 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Lew | last post by:
Hi all, I'm trying to create a page that has a user-selectable page auto-refresh option (IE 5.5). Essentially, it's a page that contains a checkbox, when the user checks the checkbox, I'd like...
0
by: Steve Barker | last post by:
Hi guys! In Visual Studio .NET, I like to enable auto-generation of XML documentation on the project properties screen, by adding an XML file name under "Configuration Properties" --> "Build"...
2
by: Tom | last post by:
I am trying to store information into a table that has an auto increment field. There is currently no data in the table. Using the code below I cannot insert data into the table. I get an error...
5
by: Geoff Cayzer | last post by:
At http://www.blueclaw-db.com/tips_tricks.htm I came across a section which is included below and was hoping for some comment on the article. -------------- Almost never use this auto-number...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
0
Zerin
by: Zerin | last post by:
Dear Friends, I always appriciate the help of this forum.Today,I`m asking for another solution. Can anyone tell me ........how to autopurge data stored ina database by VB 2005 Express? Can it...
1
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in...
1
by: glasssd | last post by:
Hi, I was hoping someone might have some ideas on how I can hack around a problem I'm having with the auto-complete feature of the ComboBox. I have a data entry application that uses a pair of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.