Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Mintyman #1
Inserting value into database based on other fields
Hi,
I have 3 fields in a form: CATEGORY, NUMBER and YEAR. In addition to
inserting these 3 fields into a database table, I would like to insert a 4th
one which is a combination of all three fields, with each field seperated by
a hyphen E.g.
CATEGORY-NUMBER-YEAR
or
31-01-05
I need this 4th field to be inserted as SERIAL_NO
I know how to use the insert record behaviour but that only picks up the 3
designated fields. I don't know how to A) create the fourth from the
combination of the previous 3 and B) insert it into the table
'PRODUCT_DESCRIPTION'
Can anyone help?
Mintyman Guest
-
Inserting Time to a SQL Database
I'm builidng a program that requires me to record the time of day that a department physcially receives a document and then when it leaves the... -
Inserting Currency into database
Hello, This should be an easy one, but somehow it eludes me. I have an update form where I display dollar amounts. I am using... -
inserting the time into database
hi i have a page where all the stories are displayed, ordered by colomn "date" descsending. the problem is that if two stories are enter on the... -
Problems inserting layer on to template based page
I'm trying to add a layer onto a page that is based on a template. When I tried to insert the layer, I got the following error message from... -
inserting a database into director
Hello, Is there any way to insert a database into director? by using lingo, or with an extra. The user needn´t modify the database, he would... -
Paul Whitham TMM #2
Re: Inserting value into database based on other fields
How easy this is depends upon the server model being used. If you are usign
ASP the DW generated coded is pretty hard to decipher, in which case I would
recommend that you manually write an insert statement.
--
Regards
Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
[url]www.valleybiz.net[/url]
Team Macromedia Volunteer for Ultradev/Dreamweaver MX
[url]www.macromedia.com/support/forums/team_macromedia[/url]
"Mintyman" <mintyman@ntlworld.com> wrote in message
news:d0jsoc$egm$1@forums.macromedia.com...4th> Hi,
>
> I have 3 fields in a form: CATEGORY, NUMBER and YEAR. In addition to
> inserting these 3 fields into a database table, I would like to insert aby> one which is a combination of all three fields, with each field seperated> a hyphen E.g.
>
> CATEGORY-NUMBER-YEAR
>
> or
>
> 31-01-05
>
> I need this 4th field to be inserted as SERIAL_NO
>
> I know how to use the insert record behaviour but that only picks up the 3
> designated fields. I don't know how to A) create the fourth from the
> combination of the previous 3 and B) insert it into the table
> 'PRODUCT_DESCRIPTION'
>
> Can anyone help?
>
>
Paul Whitham TMM Guest
-
Mintyman #3
Re: Inserting value into database based on other fields
its ASP with VBScript im using. Does help you find a solution for me?
"Paul Whitham TMM" <paul@valleybiz.net> wrote in message
news:d0l8nb$mki$1@forums.macromedia.com...usign> How easy this is depends upon the server model being used. If you arewould> ASP the DW generated coded is pretty hard to decipher, in which case Iseperated> recommend that you manually write an insert statement.
>
> --
> Regards
>
> Paul Whitham
> Macromedia Certified Professional for Dreamweaver MX2004
> Valleybiz Internet Design
> [url]www.valleybiz.net[/url]
>
> Team Macromedia Volunteer for Ultradev/Dreamweaver MX
> [url]www.macromedia.com/support/forums/team_macromedia[/url]
>
> "Mintyman" <mintyman@ntlworld.com> wrote in message
> news:d0jsoc$egm$1@forums.macromedia.com...> 4th> > Hi,
> >
> > I have 3 fields in a form: CATEGORY, NUMBER and YEAR. In addition to
> > inserting these 3 fields into a database table, I would like to insert a> > one which is a combination of all three fields, with each field3> by> > a hyphen E.g.
> >
> > CATEGORY-NUMBER-YEAR
> >
> > or
> >
> > 31-01-05
> >
> > I need this 4th field to be inserted as SERIAL_NO
> >
> > I know how to use the insert record behaviour but that only picks up the>> > designated fields. I don't know how to A) create the fourth from the
> > combination of the previous 3 and B) insert it into the table
> > 'PRODUCT_DESCRIPTION'
> >
> > Can anyone help?
> >
> >
>
Mintyman Guest
-
Paul Whitham TMM #4
Re: Inserting value into database based on other fields
This is a hand coded ASP Insert statement
<%
dim strConn
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("/_database/Conf2005.mdb")
dim strTitle
dim strContent
strTitle = Request.Form("txtTitle")
strContent = Request.Form("txtContent")
dim adoCn
dim strSQL
set adoCn = Server.CreateObject("ADODB.Connection")
adoCn.Open strConn
strSQL = "Insert Into TblPageContent (PageName, Introtext) Values ('" &
replace(strTitle,"'","''") & "','" & replace(strContent,"'","''") & "')"
adoCn.Execute strSQL
adoCn.Close
set adoCn = nothing
%>
To create a variable that would add fields together you would do something
like this
Dim strSerial
strSerial = Request.Form("CATEGORY") & "-" & Request.Form("NUMBER") & "-" &
Request.Form("YEAR")
and then add it to the insert line.
--
Regards
Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
[url]www.valleybiz.net[/url]
Team Macromedia Volunteer for Ultradev/Dreamweaver MX
[url]www.macromedia.com/support/forums/team_macromedia[/url]
"Mintyman" <mintyman@ntlworld.com> wrote in message
news:d0n2eq$gjq$1@forums.macromedia.com...a> its ASP with VBScript im using. Does help you find a solution for me?
>
>
> "Paul Whitham TMM" <paul@valleybiz.net> wrote in message
> news:d0l8nb$mki$1@forums.macromedia.com...> usign> > How easy this is depends upon the server model being used. If you are> would> > ASP the DW generated coded is pretty hard to decipher, in which case I> > recommend that you manually write an insert statement.
> >
> > --
> > Regards
> >
> > Paul Whitham
> > Macromedia Certified Professional for Dreamweaver MX2004
> > Valleybiz Internet Design
> > [url]www.valleybiz.net[/url]
> >
> > Team Macromedia Volunteer for Ultradev/Dreamweaver MX
> > [url]www.macromedia.com/support/forums/team_macromedia[/url]
> >
> > "Mintyman" <mintyman@ntlworld.com> wrote in message
> > news:d0jsoc$egm$1@forums.macromedia.com...> > > Hi,
> > >
> > > I have 3 fields in a form: CATEGORY, NUMBER and YEAR. In addition to
> > > inserting these 3 fields into a database table, I would like to insertthe> seperated> > 4th> > > one which is a combination of all three fields, with each field> > by> > > a hyphen E.g.
> > >
> > > CATEGORY-NUMBER-YEAR
> > >
> > > or
> > >
> > > 31-01-05
> > >
> > > I need this 4th field to be inserted as SERIAL_NO
> > >
> > > I know how to use the insert record behaviour but that only picks up> 3>> >> > > designated fields. I don't know how to A) create the fourth from the
> > > combination of the previous 3 and B) insert it into the table
> > > 'PRODUCT_DESCRIPTION'
> > >
> > > Can anyone help?
> > >
> > >
> >
>
Paul Whitham TMM Guest



Reply With Quote

