Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old February 2nd, 2007, 10:20 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi mr dparsons

Can you please explain to me short "string literals" and

in my database i have ,text, and ,checkboxes, how do i treat this last ones after VALUES for " Your INSERT will need to be something like INSERT INTO TABLE(<columns you want to insert data into>)VALUES(" Request.Form("name") &"," & request.Form("tradingas")) etc etc etc."

Is this as binding alright 1: <%=(Recordset1.Fields.Item("name").Value)%> 2: <%=(Recordset1.Fields.Item("tradingas").Value)%> ,

and one checkbox binding sample : <%If (CStr((Recordset1.Fields.Item("cc").Value)) = CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%>

Is this right sir.

I am not sure if this was the correct way to explain it but my question actuele is : How do i put a checkbox as VALUE

Thanks in advance

NB I wish you a very nice weekend.

lieven@wbs.co.za



Reply With Quote
  #22 (permalink)  
Old February 2nd, 2007, 10:29 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

First, string literals. String literals is any text that you are inserting into a database so the string:

I am a Programmer

Would look like this in an insert:

INSERT INTO table(sometextcolumn)Values('I am a Programmer')

however, in code you will mostly be working with variables and such so it might look like this:

Dim sText
sText = "I am a Programmer"

INSERT INTO table(sometextcolumn)Values('" &sText & "')

Checkbox values. These are nothing more then bit values, 0 being off 1 being on so if you are pulling that data from your database this logic:

<%If (CStr((Recordset1.Fields.Item("cc").Value)) = CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%>

Should be correct.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Reply With Quote
  #23 (permalink)  
Old February 2nd, 2007, 11:54 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi mr. dparsons,

The script <%If (CStr((Recordset1.Fields.Item("cc").Value)) = CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%>

has been put there by Dreamweaver.
This should be alright to PULL from the database you say.
My question is this the same to PUT into the database, since it came from the
SELECT statement.

THX

Reply With Quote
  #24 (permalink)  
Old February 2nd, 2007, 12:03 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

oh one other thing mr.

INSERT INTO table(sometextcolumn)Values('I am a Programmer')

I am not sure to understand this one, i have a asp page i have a database

poeple on the net should fill in on the page de details go are going to be

INSERT in to the database Record after Rekord.

Unless 'i am a programmer' is the name of a row or am i wrong here mr..

THX


Reply With Quote
  #25 (permalink)  
Old February 2nd, 2007, 12:06 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the details who are going to be

sorry for that

Reply With Quote
  #26 (permalink)  
Old February 2nd, 2007, 12:39 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Please excuse any condensending tone that you may gather from this post as their is none intended. I do not mind helping people on the forums but i understand that the people that are posting questions have at least beginner knowledge of the subject they are posting on and, moreover, they understand the concepts of that particular subject. To that end, I think maybe you should pick up a few books on ASP (Wrox has some good ones) as I think you are not very familiar with the language at all.

Secondly, LEARN how to code. I understand that you are using the tools available to your (Dreamweaver) but you arent learning anything and that becomes extremely important in situations like this; you didn't write the code so you don't know how to trouble shoot it.

Lastly: INSERT INTO table(sometextcolumn)Values('I am a Programmer') that was an example of a string literal being inserred into your database, it was not meant to be a functional piece of code that you could use in your application.

To PUT (aka INSERT) the checkbox value into a database you would do INSERT INTO table(cc)Values(" & Request.Form("checkbox") &")"

Checkbox here is the name of your form element that is a checkbox.



================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Reply With Quote
  #27 (permalink)  
Old February 3rd, 2007, 06:33 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mr.dparsons

Thanks for the info you give to me,

I looked at maybe something i could download who could help me with Dreamweaver and i found a Book 'Foundation ASP for Dreamweaver' by Omar Elbaga and Rob Turnbull.

Only on page 9 of the book i found out that indeed it is posseble to use a
INSERT from within Dreamweaver, something i did not see because i was blindly
using SELECT without looking further into the program.

I am going to study this book seriously and i hope maybe in a later stage i could keepon looking for you'r professionale opinion buth than in other matters.

Thanks for everything.

Reply With Quote
  #28 (permalink)  
Old February 5th, 2007, 08:09 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: , , .
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

:)

http://www.ithighway.co.uk/
Reply With Quote
  #29 (permalink)  
Old March 12th, 2007, 05:16 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mr.dparsons

I was wondering if you are still availeble and/or arround.
I did manage to make a register.asp page working, if you want http://www.business-youthlink.co.za.
My question to you Sir: the database that i use is strait forward, i should be able to demand on the page Province,preSet Type of business and gender also should be a criteria.
To make the pages with this criteria, i think i can do.
How do i stucture my database (mdb) in order to be able to do a 'search' in the database in a later stage.
For example 6monts down the line i need to now how many poeple from gauten did register and from gauteng how many, for xsample, IT people did register.
I also should be able to search for all the IT people in all provinces.

I hope you understand my question.

Thanks in advance Mr.

tagaroe
lieven@wbs.co.za

Reply With Quote
  #30 (permalink)  
Old March 12th, 2007, 06:50 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

In access, I am not sure. You are probably going to have to write a Query that will search through your necessary tables.

In SQL Server I would write a stored procedure that would search my database where the entered criteria was found and return those rows.

Lastly, how you structure it is up to you. Are you going to need to search on more then 1 table? Will you be able to join both of those tables together?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Register namespace using ASP deean Classic ASP Basics 0 June 16th, 2008 09:23 PM
ASP.NET not register under IIS evridiki ASP.NET 2.0 Basics 3 February 22nd, 2006 04:04 PM
Ch 15 Register.asp query daveyarwood BOOK: Beginning ASP 3.0 0 July 16th, 2005 12:52 PM
Register Globals Off cmiller Beginning PHP 4 August 18th, 2003 05:21 PM



All times are GMT -4. The time now is 04:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.