CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Help! CCS Forum Question

Print topic Send  topic

Author Message
Sean Brown
Posted: 12/04/2003, 8:22 AM

I am trying to create a web forum in CCS, and am having one small
difficulty.

I have three pages: Category, Thread, & Messages. Each page also has a
separate database table. The Thread page sorts by LastUpdated (Decending).

The problem I am having is that each time a new message is posted in the
Messages page, it doesn't update the Thread record LastPosted, so the thread
doesn't move up to the top. Each post has a messageID, threadID, and
categoryID, which is also stored in each table.

How can I update the Thread table & record when I post in the Messages page?
I have a hidden field called LastUpdated and I want it to update the same
threadID in the Thread table. Keep in mind that this is just an UPDATE
since the record already exists.

I hope I have explained what I want to happen. If not, let me know and I
will try to explain a different way.

Or, if someone has a CCS forum already built, I would like to see the
example.

BTW, I am using CCS 2.2, ASP & MS Access 2000

DonB
Posted: 12/04/2003, 1:59 PM

That's a job for the AfterExecuteInsert event. Put a couple lines of code
in there to do an update on the Thread row after the Message is inserted.

Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use the
equivalent in PHP or other language) to construct and execute the UPDATE.
--
DonB

http://www.gotodon.com/ccbth


"Sean Brown" <sbrown@titledata.com> wrote in message
news:bqnn0e$nhf$1@news.codecharge.com...
> I am trying to create a web forum in CCS, and am having one small
> difficulty.
>
> I have three pages: Category, Thread, & Messages. Each page also has a
> separate database table. The Thread page sorts by LastUpdated
(Decending).
>
> The problem I am having is that each time a new message is posted in the
> Messages page, it doesn't update the Thread record LastPosted, so the
thread
> doesn't move up to the top. Each post has a messageID, threadID, and
> categoryID, which is also stored in each table.
>
> How can I update the Thread table & record when I post in the Messages
page?
> I have a hidden field called LastUpdated and I want it to update the same
> threadID in the Thread table. Keep in mind that this is just an UPDATE
> since the record already exists.
>
> I hope I have explained what I want to happen. If not, let me know and I
> will try to explain a different way.
>
> Or, if someone has a CCS forum already built, I would like to see the
> example.
>
> BTW, I am using CCS 2.2, ASP & MS Access 2000
>
>

Sean Brown
Posted: 12/05/2003, 7:07 AM

I put the following code into the AfterExecuteInsert event and it worked,
but only once. After the first update, it would no longer update and did
not give any errors. Can you tell me if something is wrong?

DBConnection1.Execute ("update Thread set threadLastModified = " &
CCGetParam("msgDate", Empty) & "where threadID = " & CCGetParam("threadID",
Empty))

Thanks for the reply.

Sean

"DonB" <~ccbth~@gotodon.com> wrote in message
news:bqoan5$fv1$1@news.codecharge.com...
> That's a job for the AfterExecuteInsert event. Put a couple lines of code
> in there to do an update on the Thread row after the Message is inserted.
>
> Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use the
> equivalent in PHP or other language) to construct and execute the UPDATE.
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "Sean Brown" <sbrown@titledata.com> wrote in message
>news:bqnn0e$nhf$1@news.codecharge.com...
> > I am trying to create a web forum in CCS, and am having one small
> > difficulty.
> >
> > I have three pages: Category, Thread, & Messages. Each page also has a
> > separate database table. The Thread page sorts by LastUpdated
> (Decending).
> >
> > The problem I am having is that each time a new message is posted in the
> > Messages page, it doesn't update the Thread record LastPosted, so the
> thread
> > doesn't move up to the top. Each post has a messageID, threadID, and
> > categoryID, which is also stored in each table.
> >
> > How can I update the Thread table & record when I post in the Messages
> page?
> > I have a hidden field called LastUpdated and I want it to update the
same
> > threadID in the Thread table. Keep in mind that this is just an UPDATE
> > since the record already exists.
> >
> > I hope I have explained what I want to happen. If not, let me know and
I
> > will try to explain a different way.
> >
> > Or, if someone has a CCS forum already built, I would like to see the
> > example.
> >
> > BTW, I am using CCS 2.2, ASP & MS Access 2000
> >
> >
>
>

DonB
Posted: 12/05/2003, 9:11 AM

In situations like this, I usually put in:

Print "something to look at"
Response.End

So I can check (a) is the event firing; (b) what was the query that
executed. A "WHERE threadID = Empty" will produce an invalid UPDATE
statement, so I like to put in "0" or "-1" or some value that I know will
not result in a successful update. Better still, do you have the Execute
enclosed in "if threadID is not omitted" conditional logic so it does not
execute at all without the threadID being provided?

--
DonB

http://www.gotodon.com/ccbth


"Sean Brown" <sbrown@titledata.com> wrote in message
news:bqq6uv$o5m$1@news.codecharge.com...
> I put the following code into the AfterExecuteInsert event and it worked,
> but only once. After the first update, it would no longer update and did
> not give any errors. Can you tell me if something is wrong?
>
> DBConnection1.Execute ("update Thread set threadLastModified = " &
> CCGetParam("msgDate", Empty) & "where threadID = " &
CCGetParam("threadID",
> Empty))
>
> Thanks for the reply.
>
> Sean
>
> "DonB" <~ccbth~@gotodon.com> wrote in message
>news:bqoan5$fv1$1@news.codecharge.com...
> > That's a job for the AfterExecuteInsert event. Put a couple lines of
code
> > in there to do an update on the Thread row after the Message is
inserted.
> >
> > Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use the
> > equivalent in PHP or other language) to construct and execute the
UPDATE.
> > --
> > DonB
> >
> > http://www.gotodon.com/ccbth
> >
> >
> > "Sean Brown" <sbrown@titledata.com> wrote in message
> >news:bqnn0e$nhf$1@news.codecharge.com...
> > > I am trying to create a web forum in CCS, and am having one small
> > > difficulty.
> > >
> > > I have three pages: Category, Thread, & Messages. Each page also has
a
> > > separate database table. The Thread page sorts by LastUpdated
> > (Decending).
> > >
> > > The problem I am having is that each time a new message is posted in
the
> > > Messages page, it doesn't update the Thread record LastPosted, so the
> > thread
> > > doesn't move up to the top. Each post has a messageID, threadID, and
> > > categoryID, which is also stored in each table.
> > >
> > > How can I update the Thread table & record when I post in the Messages
> > page?
> > > I have a hidden field called LastUpdated and I want it to update the
> same
> > > threadID in the Thread table. Keep in mind that this is just an
UPDATE
> > > since the record already exists.
> > >
> > > I hope I have explained what I want to happen. If not, let me know
and
> I
> > > will try to explain a different way.
> > >
> > > Or, if someone has a CCS forum already built, I would like to see the
> > > example.
> > >
> > > BTW, I am using CCS 2.2, ASP & MS Access 2000
> > >
> > >
> >
> >
>
>

Sean Brown
Posted: 12/05/2003, 9:29 AM

No, the Execute command is exactly as I showed. Do I need to put it in an
if statement? Do you have an example of how it should look? I am new to
the is programming thing, so as many details would be very helpful.

Thanks.
Sean

"DonB" <~ccbth~@gotodon.com> wrote in message
news:bqqe7d$131$1@news.codecharge.com...
> In situations like this, I usually put in:
>
> Print "something to look at"
> Response.End
>
> So I can check (a) is the event firing; (b) what was the query that
> executed. A "WHERE threadID = Empty" will produce an invalid UPDATE
> statement, so I like to put in "0" or "-1" or some value that I know will
> not result in a successful update. Better still, do you have the Execute
> enclosed in "if threadID is not omitted" conditional logic so it does not
> execute at all without the threadID being provided?
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "Sean Brown" <sbrown@titledata.com> wrote in message
>news:bqq6uv$o5m$1@news.codecharge.com...
> > I put the following code into the AfterExecuteInsert event and it
worked,
> > but only once. After the first update, it would no longer update and
did
> > not give any errors. Can you tell me if something is wrong?
> >
> > DBConnection1.Execute ("update Thread set threadLastModified = " &
> > CCGetParam("msgDate", Empty) & "where threadID = " &
> CCGetParam("threadID",
> > Empty))
> >
> > Thanks for the reply.
> >
> > Sean
> >
> > "DonB" <~ccbth~@gotodon.com> wrote in message
> >news:bqoan5$fv1$1@news.codecharge.com...
> > > That's a job for the AfterExecuteInsert event. Put a couple lines of
> code
> > > in there to do an update on the Thread row after the Message is
> inserted.
> > >
> > > Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use
the
> > > equivalent in PHP or other language) to construct and execute the
> UPDATE.
> > > --
> > > DonB
> > >
> > > http://www.gotodon.com/ccbth
> > >
> > >
> > > "Sean Brown" <sbrown@titledata.com> wrote in message
> > >news:bqnn0e$nhf$1@news.codecharge.com...
> > > > I am trying to create a web forum in CCS, and am having one small
> > > > difficulty.
> > > >
> > > > I have three pages: Category, Thread, & Messages. Each page also
has
> a
> > > > separate database table. The Thread page sorts by LastUpdated
> > > (Decending).
> > > >
> > > > The problem I am having is that each time a new message is posted in
> the
> > > > Messages page, it doesn't update the Thread record LastPosted, so
the
> > > thread
> > > > doesn't move up to the top. Each post has a messageID, threadID,
and
> > > > categoryID, which is also stored in each table.
> > > >
> > > > How can I update the Thread table & record when I post in the
Messages
> > > page?
> > > > I have a hidden field called LastUpdated and I want it to update the
> > same
> > > > threadID in the Thread table. Keep in mind that this is just an
> UPDATE
> > > > since the record already exists.
> > > >
> > > > I hope I have explained what I want to happen. If not, let me know
> and
> > I
> > > > will try to explain a different way.
> > > >
> > > > Or, if someone has a CCS forum already built, I would like to see
the
> > > > example.
> > > >
> > > > BTW, I am using CCS 2.2, ASP & MS Access 2000
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Sean Brown
Posted: 12/05/2003, 9:36 AM

This is what I get when putting in the print command:

12/05/2003 11:12:45 AMwhere threadID=5

These are the correct parameters I am trying to pass to the other table.


"Sean Brown" <sbrown@titledata.com> wrote in message
news:bqqf9b$252$1@news.codecharge.com...
> No, the Execute command is exactly as I showed. Do I need to put it in an
> if statement? Do you have an example of how it should look? I am new to
> the is programming thing, so as many details would be very helpful.
>
> Thanks.
> Sean
>
> "DonB" <~ccbth~@gotodon.com> wrote in message
>news:bqqe7d$131$1@news.codecharge.com...
> > In situations like this, I usually put in:
> >
> > Print "something to look at"
> > Response.End
> >
> > So I can check (a) is the event firing; (b) what was the query that
> > executed. A "WHERE threadID = Empty" will produce an invalid UPDATE
> > statement, so I like to put in "0" or "-1" or some value that I know
will
> > not result in a successful update. Better still, do you have the
Execute
> > enclosed in "if threadID is not omitted" conditional logic so it does
not
> > execute at all without the threadID being provided?
> >
> > --
> > DonB
> >
> > http://www.gotodon.com/ccbth
> >
> >
> > "Sean Brown" <sbrown@titledata.com> wrote in message
> >news:bqq6uv$o5m$1@news.codecharge.com...
> > > I put the following code into the AfterExecuteInsert event and it
> worked,
> > > but only once. After the first update, it would no longer update and
> did
> > > not give any errors. Can you tell me if something is wrong?
> > >
> > > DBConnection1.Execute ("update Thread set threadLastModified = " &
> > > CCGetParam("msgDate", Empty) & "where threadID = " &
> > CCGetParam("threadID",
> > > Empty))
> > >
> > > Thanks for the reply.
> > >
> > > Sean
> > >
> > > "DonB" <~ccbth~@gotodon.com> wrote in message
> > >news:bqoan5$fv1$1@news.codecharge.com...
> > > > That's a job for the AfterExecuteInsert event. Put a couple lines
of
> > code
> > > > in there to do an update on the Thread row after the Message is
> > inserted.
> > > >
> > > > Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use
> the
> > > > equivalent in PHP or other language) to construct and execute the
> > UPDATE.
> > > > --
> > > > DonB
> > > >
> > > > http://www.gotodon.com/ccbth
> > > >
> > > >
> > > > "Sean Brown" <sbrown@titledata.com> wrote in message
> > > >news:bqnn0e$nhf$1@news.codecharge.com...
> > > > > I am trying to create a web forum in CCS, and am having one small
> > > > > difficulty.
> > > > >
> > > > > I have three pages: Category, Thread, & Messages. Each page also
> has
> > a
> > > > > separate database table. The Thread page sorts by LastUpdated
> > > > (Decending).
> > > > >
> > > > > The problem I am having is that each time a new message is posted
in
> > the
> > > > > Messages page, it doesn't update the Thread record LastPosted, so
> the
> > > > thread
> > > > > doesn't move up to the top. Each post has a messageID, threadID,
> and
> > > > > categoryID, which is also stored in each table.
> > > > >
> > > > > How can I update the Thread table & record when I post in the
> Messages
> > > > page?
> > > > > I have a hidden field called LastUpdated and I want it to update
the
> > > same
> > > > > threadID in the Thread table. Keep in mind that this is just an
> > UPDATE
> > > > > since the record already exists.
> > > > >
> > > > > I hope I have explained what I want to happen. If not, let me
know
> > and
> > > I
> > > > > will try to explain a different way.
> > > > >
> > > > > Or, if someone has a CCS forum already built, I would like to see
> the
> > > > > example.
> > > > >
> > > > > BTW, I am using CCS 2.2, ASP & MS Access 2000
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Sean Brown
Posted: 12/05/2003, 9:39 AM

Actually, this is exactlywhat is happening

update Thread set threadLastModified = 12/05/2003 11:12:45 AMwhere threadID
= 5


"Sean Brown" <sbrown@titledata.com> wrote in message
news:bqqfmb$2mf$1@news.codecharge.com...
> This is what I get when putting in the print command:
>
> 12/05/2003 11:12:45 AMwhere threadID=5
>
> These are the correct parameters I am trying to pass to the other table.
>
>
> "Sean Brown" <sbrown@titledata.com> wrote in message
>news:bqqf9b$252$1@news.codecharge.com...
> > No, the Execute command is exactly as I showed. Do I need to put it in
an
> > if statement? Do you have an example of how it should look? I am new
to
> > the is programming thing, so as many details would be very helpful.
> >
> > Thanks.
> > Sean
> >
> > "DonB" <~ccbth~@gotodon.com> wrote in message
> >news:bqqe7d$131$1@news.codecharge.com...
> > > In situations like this, I usually put in:
> > >
> > > Print "something to look at"
> > > Response.End
> > >
> > > So I can check (a) is the event firing; (b) what was the query that
> > > executed. A "WHERE threadID = Empty" will produce an invalid UPDATE
> > > statement, so I like to put in "0" or "-1" or some value that I know
> will
> > > not result in a successful update. Better still, do you have the
> Execute
> > > enclosed in "if threadID is not omitted" conditional logic so it does
> not
> > > execute at all without the threadID being provided?
> > >
> > > --
> > > DonB
> > >
> > > http://www.gotodon.com/ccbth
> > >
> > >
> > > "Sean Brown" <sbrown@titledata.com> wrote in message
> > >news:bqq6uv$o5m$1@news.codecharge.com...
> > > > I put the following code into the AfterExecuteInsert event and it
> > worked,
> > > > but only once. After the first update, it would no longer update
and
> > did
> > > > not give any errors. Can you tell me if something is wrong?
> > > >
> > > > DBConnection1.Execute ("update Thread set threadLastModified = " &
> > > > CCGetParam("msgDate", Empty) & "where threadID = " &
> > > CCGetParam("threadID",
> > > > Empty))
> > > >
> > > > Thanks for the reply.
> > > >
> > > > Sean
> > > >
> > > > "DonB" <~ccbth~@gotodon.com> wrote in message
> > > >news:bqoan5$fv1$1@news.codecharge.com...
> > > > > That's a job for the AfterExecuteInsert event. Put a couple lines
> of
> > > code
> > > > > in there to do an update on the Thread row after the Message is
> > > inserted.
> > > > >
> > > > > Use the <connection>.Execute ("UPDATE Threads ...") (for ASP -
use
> > the
> > > > > equivalent in PHP or other language) to construct and execute the
> > > UPDATE.
> > > > > --
> > > > > DonB
> > > > >
> > > > > http://www.gotodon.com/ccbth
> > > > >
> > > > >
> > > > > "Sean Brown" <sbrown@titledata.com> wrote in message
> > > > >news:bqnn0e$nhf$1@news.codecharge.com...
> > > > > > I am trying to create a web forum in CCS, and am having one
small
> > > > > > difficulty.
> > > > > >
> > > > > > I have three pages: Category, Thread, & Messages. Each page
also
> > has
> > > a
> > > > > > separate database table. The Thread page sorts by LastUpdated
> > > > > (Decending).
> > > > > >
> > > > > > The problem I am having is that each time a new message is
posted
> in
> > > the
> > > > > > Messages page, it doesn't update the Thread record LastPosted,
so
> > the
> > > > > thread
> > > > > > doesn't move up to the top. Each post has a messageID,
threadID,
> > and
> > > > > > categoryID, which is also stored in each table.
> > > > > >
> > > > > > How can I update the Thread table & record when I post in the
> > Messages
> > > > > page?
> > > > > > I have a hidden field called LastUpdated and I want it to update
> the
> > > > same
> > > > > > threadID in the Thread table. Keep in mind that this is just an
> > > UPDATE
> > > > > > since the record already exists.
> > > > > >
> > > > > > I hope I have explained what I want to happen. If not, let me
> know
> > > and
> > > > I
> > > > > > will try to explain a different way.
> > > > > >
> > > > > > Or, if someone has a CCS forum already built, I would like to
see
> > the
> > > > > > example.
> > > > > >
> > > > > > BTW, I am using CCS 2.2, ASP & MS Access 2000
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

David Harrison
Posted: 12/05/2003, 10:56 AM

Try adding a space before your 'where' statement. It's running together with
the time.

David Harrison
"Sean Brown" <sbrown@titledata.com> wrote in message
news:bqq6uv$o5m$1@news.codecharge.com...
> I put the following code into the AfterExecuteInsert event and it worked,
> but only once. After the first update, it would no longer update and did
> not give any errors. Can you tell me if something is wrong?
>
> DBConnection1.Execute ("update Thread set threadLastModified = " &
> CCGetParam("msgDate", Empty) & "where threadID = " &
CCGetParam("threadID",
> Empty))
>
> Thanks for the reply.
>
> Sean
>
> "DonB" <~ccbth~@gotodon.com> wrote in message
>news:bqoan5$fv1$1@news.codecharge.com...
> > That's a job for the AfterExecuteInsert event. Put a couple lines of
code
> > in there to do an update on the Thread row after the Message is
inserted.
> >
> > Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use the
> > equivalent in PHP or other language) to construct and execute the
UPDATE.
> > --
> > DonB
> >
> > http://www.gotodon.com/ccbth
> >
> >
> > "Sean Brown" <sbrown@titledata.com> wrote in message
> >news:bqnn0e$nhf$1@news.codecharge.com...
> > > I am trying to create a web forum in CCS, and am having one small
> > > difficulty.
> > >
> > > I have three pages: Category, Thread, & Messages. Each page also has
a
> > > separate database table. The Thread page sorts by LastUpdated
> > (Decending).
> > >
> > > The problem I am having is that each time a new message is posted in
the
> > > Messages page, it doesn't update the Thread record LastPosted, so the
> > thread
> > > doesn't move up to the top. Each post has a messageID, threadID, and
> > > categoryID, which is also stored in each table.
> > >
> > > How can I update the Thread table & record when I post in the Messages
> > page?
> > > I have a hidden field called LastUpdated and I want it to update the
> same
> > > threadID in the Thread table. Keep in mind that this is just an
UPDATE
> > > since the record already exists.
> > >
> > > I hope I have explained what I want to happen. If not, let me know
and
> I
> > > will try to explain a different way.
> > >
> > > Or, if someone has a CCS forum already built, I would like to see the
> > > example.
> > >
> > > BTW, I am using CCS 2.2, ASP & MS Access 2000
> > >
> > >
> >
> >
>
>

Sean Brown
Posted: 12/05/2003, 12:23 PM

Ok, I tried adding a space, and it is still not updating. Here is the Print

update Thread set threadLastModified = 12/05/2003 2:19:48 PM where
threadID=4

Any other ideas???

"David Harrison" <davidh@saltydog.net> wrote in message
news:bqqkcq$80r$1@news.codecharge.com...
> Try adding a space before your 'where' statement. It's running together
with
> the time.
>
> David Harrison
> "Sean Brown" <sbrown@titledata.com> wrote in message
>news:bqq6uv$o5m$1@news.codecharge.com...
> > I put the following code into the AfterExecuteInsert event and it
worked,
> > but only once. After the first update, it would no longer update and
did
> > not give any errors. Can you tell me if something is wrong?
> >
> > DBConnection1.Execute ("update Thread set threadLastModified = " &
> > CCGetParam("msgDate", Empty) & "where threadID = " &
> CCGetParam("threadID",
> > Empty))
> >
> > Thanks for the reply.
> >
> > Sean
> >
> > "DonB" <~ccbth~@gotodon.com> wrote in message
> >news:bqoan5$fv1$1@news.codecharge.com...
> > > That's a job for the AfterExecuteInsert event. Put a couple lines of
> code
> > > in there to do an update on the Thread row after the Message is
> inserted.
> > >
> > > Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use
the
> > > equivalent in PHP or other language) to construct and execute the
> UPDATE.
> > > --
> > > DonB
> > >
> > > http://www.gotodon.com/ccbth
> > >
> > >
> > > "Sean Brown" <sbrown@titledata.com> wrote in message
> > >news:bqnn0e$nhf$1@news.codecharge.com...
> > > > I am trying to create a web forum in CCS, and am having one small
> > > > difficulty.
> > > >
> > > > I have three pages: Category, Thread, & Messages. Each page also
has
> a
> > > > separate database table. The Thread page sorts by LastUpdated
> > > (Decending).
> > > >
> > > > The problem I am having is that each time a new message is posted in
> the
> > > > Messages page, it doesn't update the Thread record LastPosted, so
the
> > > thread
> > > > doesn't move up to the top. Each post has a messageID, threadID,
and
> > > > categoryID, which is also stored in each table.
> > > >
> > > > How can I update the Thread table & record when I post in the
Messages
> > > page?
> > > > I have a hidden field called LastUpdated and I want it to update the
> > same
> > > > threadID in the Thread table. Keep in mind that this is just an
> UPDATE
> > > > since the record already exists.
> > > >
> > > > I hope I have explained what I want to happen. If not, let me know
> and
> > I
> > > > will try to explain a different way.
> > > >
> > > > Or, if someone has a CCS forum already built, I would like to see
the
> > > > example.
> > > >
> > > > BTW, I am using CCS 2.2, ASP & MS Access 2000
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Sean Brown
Posted: 12/05/2003, 1:25 PM

I was missing a couple of single quotes, just like you said Don. Thanks a
bunch!

DBGordon.Execute ("update Thread set threadLastModified = '" &
CCGetParam("threadLastModified", Empty) & "' where threadID=" &
CCGetParam("threadID", Empty))

Sean

"David Harrison" <davidh@saltydog.net> wrote in message
news:bqqkcq$80r$1@news.codecharge.com...
> Try adding a space before your 'where' statement. It's running together
with
> the time.
>
> David Harrison
> "Sean Brown" <sbrown@titledata.com> wrote in message
>news:bqq6uv$o5m$1@news.codecharge.com...
> > I put the following code into the AfterExecuteInsert event and it
worked,
> > but only once. After the first update, it would no longer update and
did
> > not give any errors. Can you tell me if something is wrong?
> >
> > DBConnection1.Execute ("update Thread set threadLastModified = " &
> > CCGetParam("msgDate", Empty) & "where threadID = " &
> CCGetParam("threadID",
> > Empty))
> >
> > Thanks for the reply.
> >
> > Sean
> >
> > "DonB" <~ccbth~@gotodon.com> wrote in message
> >news:bqoan5$fv1$1@news.codecharge.com...
> > > That's a job for the AfterExecuteInsert event. Put a couple lines of
> code
> > > in there to do an update on the Thread row after the Message is
> inserted.
> > >
> > > Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use
the
> > > equivalent in PHP or other language) to construct and execute the
> UPDATE.
> > > --
> > > DonB
> > >
> > > http://www.gotodon.com/ccbth
> > >
> > >
> > > "Sean Brown" <sbrown@titledata.com> wrote in message
> > >news:bqnn0e$nhf$1@news.codecharge.com...
> > > > I am trying to create a web forum in CCS, and am having one small
> > > > difficulty.
> > > >
> > > > I have three pages: Category, Thread, & Messages. Each page also
has
> a
> > > > separate database table. The Thread page sorts by LastUpdated
> > > (Decending).
> > > >
> > > > The problem I am having is that each time a new message is posted in
> the
> > > > Messages page, it doesn't update the Thread record LastPosted, so
the
> > > thread
> > > > doesn't move up to the top. Each post has a messageID, threadID,
and
> > > > categoryID, which is also stored in each table.
> > > >
> > > > How can I update the Thread table & record when I post in the
Messages
> > > page?
> > > > I have a hidden field called LastUpdated and I want it to update the
> > same
> > > > threadID in the Thread table. Keep in mind that this is just an
> UPDATE
> > > > since the record already exists.
> > > >
> > > > I hope I have explained what I want to happen. If not, let me know
> and
> > I
> > > > will try to explain a different way.
> > > >
> > > > Or, if someone has a CCS forum already built, I would like to see
the
> > > > example.
> > > >
> > > > BTW, I am using CCS 2.2, ASP & MS Access 2000
> > > >
> > > >
> > >
> > >
> >
> >
>
>

DonB
Posted: 12/05/2003, 1:48 PM

Good deal. I had to run to an appointment to get to so the last response
was pretty brief. - sorry.
I also missed the run-together WHERE.

I use the Print/Response.End statements a lot. Sometimes you just don't get
what you think you are asking for in your code and it helps to display these
things.
--
DonB

http://www.gotodon.com/ccbth


"Sean Brown" <sbrown@titledata.com> wrote in message
news:bqqt56$hmm$1@news.codecharge.com...
> I was missing a couple of single quotes, just like you said Don. Thanks a
> bunch!
>
> DBGordon.Execute ("update Thread set threadLastModified = '" &
> CCGetParam("threadLastModified", Empty) & "' where threadID=" &
> CCGetParam("threadID", Empty))
>
> Sean
>
> "David Harrison" <davidh@saltydog.net> wrote in message
>news:bqqkcq$80r$1@news.codecharge.com...
> > Try adding a space before your 'where' statement. It's running together
> with
> > the time.
> >
> > David Harrison
> > "Sean Brown" <sbrown@titledata.com> wrote in message
> >news:bqq6uv$o5m$1@news.codecharge.com...
> > > I put the following code into the AfterExecuteInsert event and it
> worked,
> > > but only once. After the first update, it would no longer update and
> did
> > > not give any errors. Can you tell me if something is wrong?
> > >
> > > DBConnection1.Execute ("update Thread set threadLastModified = " &
> > > CCGetParam("msgDate", Empty) & "where threadID = " &
> > CCGetParam("threadID",
> > > Empty))
> > >
> > > Thanks for the reply.
> > >
> > > Sean
> > >
> > > "DonB" <~ccbth~@gotodon.com> wrote in message
> > >news:bqoan5$fv1$1@news.codecharge.com...
> > > > That's a job for the AfterExecuteInsert event. Put a couple lines
of
> > code
> > > > in there to do an update on the Thread row after the Message is
> > inserted.
> > > >
> > > > Use the <connection>.Execute ("UPDATE Threads ...") (for ASP - use
> the
> > > > equivalent in PHP or other language) to construct and execute the
> > UPDATE.
> > > > --
> > > > DonB
> > > >
> > > > http://www.gotodon.com/ccbth
> > > >
> > > >
> > > > "Sean Brown" <sbrown@titledata.com> wrote in message
> > > >news:bqnn0e$nhf$1@news.codecharge.com...
> > > > > I am trying to create a web forum in CCS, and am having one small
> > > > > difficulty.
> > > > >
> > > > > I have three pages: Category, Thread, & Messages. Each page also
> has
> > a
> > > > > separate database table. The Thread page sorts by LastUpdated
> > > > (Decending).
> > > > >
> > > > > The problem I am having is that each time a new message is posted
in
> > the
> > > > > Messages page, it doesn't update the Thread record LastPosted, so
> the
> > > > thread
> > > > > doesn't move up to the top. Each post has a messageID, threadID,
> and
> > > > > categoryID, which is also stored in each table.
> > > > >
> > > > > How can I update the Thread table & record when I post in the
> Messages
> > > > page?
> > > > > I have a hidden field called LastUpdated and I want it to update
the
> > > same
> > > > > threadID in the Thread table. Keep in mind that this is just an
> > UPDATE
> > > > > since the record already exists.
> > > > >
> > > > > I hope I have explained what I want to happen. If not, let me
know
> > and
> > > I
> > > > > will try to explain a different way.
> > > > >
> > > > > Or, if someone has a CCS forum already built, I would like to see
> the
> > > > > example.
> > > > >
> > > > > BTW, I am using CCS 2.2, ASP & MS Access 2000
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.