 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 20th, 2005, 08:48 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Yes, it will only work on the next page - you haven't submitted the form yet!
|
|

January 20th, 2005, 08:49 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/mackenzie/asp/agency_admin.asp, line 405, column 107
Dim myQuery: myQuery = ("INSERT INTO company(adv_book_time) VALUES('" & Replace(myValue, "'", "''" & "');")
----------------------------------------------------------------------------------------------------------^
|
|

January 20th, 2005, 08:53 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<%
adv_book_time = Trim(Request.Form(adv_book_time))
If adv_book_time <> "" Then ("INSERT INTO company(adv_book_time) VALUES('" & adv_book_time &, "'", "''" & "');")
End If
%>
Whats wrong with that syntax? Why does it give me this error................
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/mackenzie/asp/agency_admin.asp, line 404, column 28
If adv_book_time <> "" Then ("INSERT INTO company(adv_book_time) VALUES('" & adv_book_time &, "'", "''" & "');")
It is pointing at adv_book_time in the mysql string
|
|

January 20th, 2005, 09:26 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Change the below line
If adv_book_time <> "" Then ("INSERT INTO company(adv_book_time) VALUES('" & adv_book_time &, "'", "''" & "');")
to
If adv_book_time <> "" Then ("INSERT INTO company(adv_book_time) VALUES('" & adv_book_time &, "');")
|
|

January 20th, 2005, 09:59 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/mackenzie/asp/agency_admin.asp, line 403, column 28
If adv_book_time <> "" Then ("INSERT INTO company(adv_book_time) VALUES('" & adv_book_time &, "');")
--------------------------------------------------^
|
|

January 20th, 2005, 10:01 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<%
adv_book_time = Trim(Request.Form(adv_book_time))
If adv_book_time <> "" Then ("INSERT INTO company(adv_book_time) VALUES('" & adv_book_time & "');")
End If
%>
The ASP above is directly below the <select> tags (drop down menu)
Should it still work?
Picco
|
|

January 20th, 2005, 10:08 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
What exactly are you trying to do with this section of code?
|
|

January 20th, 2005, 10:10 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Once a value is selected from the drop-down menu it is taken and added to the database table.
|
|

January 20th, 2005, 10:12 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
do i have to submit the form first?
|
|

January 20th, 2005, 10:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Quote:
quote:Originally posted by crmpicco
do i have to submit the form first?
|
Yes, that way you can access it's fields from the Request object.
You can then build an insert query based on those values, then create a connection to your database & execute the query using that connection.
|
|
 |