Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Joining form field values and inserting into database

LEGEND ,
Oct 01, 2008 Oct 01, 2008
Hi all

I have a form that has four text fields that need joining together before
being entered into the database.

Does anyone know how i can acheive this?
I'm using the DW command Behavior and the code below.
I've come up with the code directly below, but im not sure how to impliment
it.

Thanks
Andy

<% If Request("updateme") <>"" Then %>
<% Dim Cust_Ref
Cust_Ref = Request("cr1")&"/"& Request("cr2")&"/"& Request("cr3")&"/"&
Request("cr4") %>
<% end if
%>


<%
if(Request("Cust_ref") <> "") then Cal_Update__MMColParam11 =
Request("Cust_ref")
%>

<%

set Cal_Update = Server.CreateObject("ADODB.Command")
Cal_Update.ActiveConnection = MM_calcert_STRING
Cal_Update.CommandText = "UPDATE Calibrations SET Cust_Ref='" +
Replace(Cal_Update__MMColParam11, "'", "''") + "' WHERE Inst_ID = '" +
Replace(Cal_Update__MMColParam10, "'", "''") + "' "
Cal_Update.CommandType = 1
Cal_Update.CommandTimeout = 0
Cal_Update.Prepared = true
Cal_Update.Execute()
Response.Redirect("update_1.asp?InstID="&(RSCerts1.Fields.Item("Inst_ID").Value))
%>


TOPICS
Server side applications
254
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2008 Oct 01, 2008
Forgot to mention that im using classic ASP - Access Database - DW 8
Thanks
Andy

"Andy" <andy@work.com> wrote in message
news:gbvl99$563$1@forums.macromedia.com...
> Hi all
>
> I have a form that has four text fields that need joining together before
> being entered into the database.
>
> Does anyone know how i can acheive this?
> I'm using the DW command Behavior and the code below.
> I've come up with the code directly below, but im not sure how to
> impliment it.
>
> Thanks
> Andy
>
> <% If Request("updateme") <>"" Then %>
> <% Dim Cust_Ref
> Cust_Ref = Request("cr1")&"/"& Request("cr2")&"/"& Request("cr3")&"/"&
> Request("cr4") %>
> <% end if
> %>
>
>
> <%
> if(Request("Cust_ref") <> "") then Cal_Update__MMColParam11 =
> Request("Cust_ref")
> %>
>
> <%
>
> set Cal_Update = Server.CreateObject("ADODB.Command")
> Cal_Update.ActiveConnection = MM_calcert_STRING
> Cal_Update.CommandText = "UPDATE Calibrations SET Cust_Ref='" +
> Replace(Cal_Update__MMColParam11, "'", "''") + "' WHERE Inst_ID = '" +
> Replace(Cal_Update__MMColParam10, "'", "''") + "' "
> Cal_Update.CommandType = 1
> Cal_Update.CommandTimeout = 0
> Cal_Update.Prepared = true
> Cal_Update.Execute()
> Response.Redirect("update_1.asp?InstID="&(RSCerts1.Fields.Item("Inst_ID").Value))
> %>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2008 Oct 01, 2008
It's ok guys - i've done it :-D
I simply changed the code below to this:
if(Request("Cust_ref") <> "") then Cal_Update__MMColParam11 =
Request("cr1")&"/"& Request("cr2")&"/"& Request("cr3")&"/"& Request("cr4")

For anyone else who may need it.

Thanks
Andy



"Andy" <andy@work.com> wrote in message
news:gbvlo9$5ok$1@forums.macromedia.com...
> Forgot to mention that im using classic ASP - Access Database - DW 8
> Thanks
> Andy
>
> "Andy" <andy@work.com> wrote in message
> news:gbvl99$563$1@forums.macromedia.com...
>> Hi all
>>
>> I have a form that has four text fields that need joining together before
>> being entered into the database.
>>
>> Does anyone know how i can acheive this?
>> I'm using the DW command Behavior and the code below.
>> I've come up with the code directly below, but im not sure how to
>> impliment it.
>>
>> Thanks
>> Andy
>>
>> <% If Request("updateme") <>"" Then %>
>> <% Dim Cust_Ref
>> Cust_Ref = Request("cr1")&"/"& Request("cr2")&"/"& Request("cr3")&"/"&
>> Request("cr4") %>
>> <% end if
>> %>
>>
>>
>> <%
>> if(Request("Cust_ref") <> "") then Cal_Update__MMColParam11 =
>> Request("Cust_ref")
>> %>
>>
>> <%
>>
>> set Cal_Update = Server.CreateObject("ADODB.Command")
>> Cal_Update.ActiveConnection = MM_calcert_STRING
>> Cal_Update.CommandText = "UPDATE Calibrations SET Cust_Ref='" +
>> Replace(Cal_Update__MMColParam11, "'", "''") + "' WHERE Inst_ID = '" +
>> Replace(Cal_Update__MMColParam10, "'", "''") + "' "
>> Cal_Update.CommandType = 1
>> Cal_Update.CommandTimeout = 0
>> Cal_Update.Prepared = true
>> Cal_Update.Execute()
>> Response.Redirect("update_1.asp?InstID="&(RSCerts1.Fields.Item("Inst_ID").Value))
>> %>
>>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2008 Oct 01, 2008
LATEST
Andy wrote:
> It's ok guys - i've done it :-D
> I simply changed the code below to this:
> if(Request("Cust_ref") <> "") then Cal_Update__MMColParam11 =
> Request("cr1")&"/"& Request("cr2")&"/"& Request("cr3")&"/"& Request("cr4")
>
> For anyone else who may need it.

Well done Andy, you got there in the end, keep up the good work!

Dooza

--
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines