|
 |
asp_databases thread: Beginning ASP Databases
Message #1 by "Phil Perks" <philp@w...> on Mon, 14 Aug 2000 15:52:54
|
|
-----Original Message-----
From: Ken Winfield [mailto:klwinfield@f...]
Sent: 14 August 2000 14:08
To: support@w...
Subject: Beginning ASP Databases
Hi Support Team,
Thanks for taking my email. I purchased your book Beginning ASP
Databases and like the book very much. I especially like the way the
code is broke down into sections, explaining each section. I have
several pages where the user enters data and submits to populate a
database, no problem with that part.
Here is the problem I am having and what I have tried.
I want a page that has a combo box populated by values from a table
(like exercise 2 on page 389, except that is update not add, whatever)
and text boxes that the user types in data. Then when the user submits
the value from the combo box and the values from the text box populates
the database table. Now let me say, I can can get either to work without
the other. i.e. if I just have textboxs, no problem or just combo, no
problem. But when I try to put both together I cannot get them to work.
I tried using the hidden field and move the value over from the combo
box, this worked fine in explorer but not in Netscape.
I am needing something very similar to your New Member page on page 23
on your book, I found the register.asp in the demo files but the book
doesn't explain it, it was not quite as simple as my little brain. Do
you have a plain sample asp page that uses a combo box (populated from a
database) and some text boxes, that when the user submits it populates a
table in a database. If I see one that works I feel I can figure it out,
please let me know so I can download it or email it to me......
I like your book and the fact that you support your customers.
I am using PWS for testing
Access 97 tables
Netscape 4.73 and IE 5.5
Please email response to both email addresses since I may be at work or
at home...
Thanks,
Ken Winfield
kenman@u...
klwinfield@f...
Message #2 by "Ken Schaefer" <ken@a...> on Tue, 15 Aug 2000 12:48:15 +1000
|
|
--- page1.asp ---
<form method="post" action="page2.asp">
<input type="text" name="t1"><br>
<input type="text" name="t2"><br>
<select name="t3">
<% Do while not objRS.EOF%>
<option value="<% =objRS("ID")%>"><% =objRS("Name")%></option>
</select><br>
<input type="submit">
</form>
--- page2.asp ---
strTextField1 = Request.Form("t1")
strTextField2 = Request.Form("t2")
intTextField3 = Request.Form("t3")
If isNumeric(intTextField2) then
strSQL = "UPDATE table1 "
strSQL = strSQL & "SET UserName = '" & strTextField1 & "', "
strSQL = strSQL & "OtherField = '" & strTextField2 & "' "
strSQL = strSQL & "WHERE UserID = " & intTextField3
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
objConn.execute(strSQL)
objConn.close
Set objConn = nothing
End if
HTH
Cheers
Ken
> -----Original Message-----
> From: Ken Winfield [mailto:klwinfield@f...]
> Sent: 14 August 2000 14:08
> To: support@w...
> Subject: Beginning ASP Databases
>
>
> Hi Support Team,
>
> Thanks for taking my email. I purchased your book Beginning ASP
> Databases and like the book very much. I especially like the way the
> code is broke down into sections, explaining each section. I have
> several pages where the user enters data and submits to populate a
> database, no problem with that part.
>
> Here is the problem I am having and what I have tried.
>
> I want a page that has a combo box populated by values from a table
> (like exercise 2 on page 389, except that is update not add, whatever)
> and text boxes that the user types in data. Then when the user submits
> the value from the combo box and the values from the text box populates
> the database table. Now let me say, I can can get either to work without
> the other. i.e. if I just have textboxs, no problem or just combo, no
> problem. But when I try to put both together I cannot get them to work.
> I tried using the hidden field and move the value over from the combo
> box, this worked fine in explorer but not in Netscape.
>
> I am needing something very similar to your New Member page on page 23
> on your book, I found the register.asp in the demo files but the book
> doesn't explain it, it was not quite as simple as my little brain. Do
> you have a plain sample asp page that uses a combo box (populated from a
> database) and some text boxes, that when the user submits it populates a
> table in a database. If I see one that works I feel I can figure it out,
> please let me know so I can download it or email it to me......
>
> I like your book and the fact that you support your customers.
>
> I am using PWS for testing
> Access 97 tables
> Netscape 4.73 and IE 5.5
>
> Please email response to both email addresses since I may be at work or
> at home...
>
> Thanks,
>
> Ken Winfield
> kenman@u...
> klwinfield@f...
>
> ---
> You are currently subscribed to asp_databases
$subst('Email.Unsub')
>
|
|
 |