DUClassified change the duaration of an ad.

Category »  ASP
Posted By Guido on 24 March 2006
Comments   |   Print   |   Mail it
DUClassified change the duaration of an ad.

Please remember to a make a copy of your database.
I would suggest you also print out this article.
I take no responsiblity for any thing that might happen to your database. Using the following article asumes that you accept it's your responsiblity and any problems that might arise through using this article.

This seem to be a topic which a lot of people are asking well if you know then this article is NOT for you since you will know how to change how long an ad is displayed for.
If however you don't know and would like to know how to do it read on.

In this article I will show you how to change the duration an ad.

Firstly I will do it with MS Access for those of you who have Access and then show you how to do it without Access since this seems to be a problem not many people do have MS Access.

OK lets go. Open the DUclassified database using access just double click on the db and access should fire up.
Once the db is open you should see a list of tables which the db holds


OK so far? Good. Highlight ADS (that just one click) and then click on Design (it's next to OPEN).
You should now see a list with about 14 items in the list.
Look down the list for AD_EXPIRED click on it. Have you done that.

Look down at the bottom of the window in the Field Properties The general field properties should be displayed. Look down the list for the default value this should be Date()+30 Do you see it, yes good! No opps try again from the top.
Now for the hard part. Decide how long do you want your ads displayed for.
OK that done. All that needs to be done is to change the 30 in the Date()+30 to the length of time you want the ads displayed so for 4 days the expression would be Date()+4 get the idea. Once you have changed the default value to the value you want just close down MS Access, it may ask you if you want to save the changes doh well yes you do want the changes saved!

I don't have MS Access.

Well, Microsoft will not get rich from you. (Joke)
OK The software I am using you will have to download and set-up it's really easy to use as long as you remember it's an ASP script so you will need an ASP server to run it or use your PC that has DUclassified running on.
The software is called aspAccessEditor 1.0.0 writen by Dennis Pallett (AspIt) you should find it in the applications.

OK when you have set-up aspAccessEditor log-in.
If you don't know the passwords then open up pwdprotect.asp using notepad look down the file for userUsername change that to what ever then look for userPassword change that to what ever then try logging in with your new details.

You should see that you now have to enter where your database is type that in, now do you see the Welcome message in the right pane of the frame and HOME in the left.

Under the HOME link it should display the table that are contained in the database. Click on th ADS link and the right part of the frame changes to display the table contents look for AD_EXPIRED it should be the forth one down on the list.
You can see the default value is Date()+30 this means the ad is visable for 30 days from when it wasa submitted. So how long do you want the ad to be displayed? Once you have an idea we can procced!

OK you have a number of days in mind for this example I'll change it  to display an ad for 4 days.

Near the bottom of the page in aspAccessEditor you should see

  •  Add new field : 1 GO

Click on GO

You should now see

Field Type Null Default Extra*

What you have to do is create a new field with this info

Field             AD_EXP
Type             Date
Null               not null
Default           Date()+4
Extra*            LEAVE THIS BLANK!!!!!!!

Once you have done that click add. Your new field is now displayed. Located the AD_EXPIRED field and click drop this deletes it from the database. Once you have clicked drop you will be asked if you are sure. Click OK. Once back to the list of fields locate the field we made earlier AD_EXP click on change once you are in the change window we can complete the name of the AD_EXP field to AD_EXPIRE once you have done this click save.

You have now changed the database to display the ad in the example above it would display the ad for 4 days. But you could have used your own value.

That's it done.

Hope you managed to follow my ramblings.

Thanks to Dennis Pallett  (AspIt)  for letting me use aspAccessEditor for the article. Don't forget to visit his site for aspAccessEditor


Powered by Active News