Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Old 08-06-2000, 10:12 AM   #1
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
Post

Believe it or not I am now a webmaster/asp programmer. I am not good at asp yet, but I'm learning as I go along. Most of my asp work is done to connect to an access database and grab basic information, update it, or add new records. I am still having some basic problems and was hoping someone could go to...
http://www.vbforums.com/showthread.php?threadid=25474

... and see if they know either answer. Thank you very much for any help.


------------------
If you think an education is expensive...try ignorance.
artsapimp is offline   Reply With Quote
Old 08-06-2000, 04:55 PM   #2
Member (9 bit)
 
Join Date: Dec 1999
Location: Midland, NC, USA
Posts: 292
Post

Assuming you have all these controls in a form, you could do the following for the select/text duo:

As you process the "request.form" fields, you could build your SQL statement for accessing Access like this:
strSQL = "select (whatever you're going to select) from (whatever the table name is) where " & request.form("search") & " = """ & request.form("criteria") & """"

Yeah. There's those dang triple- and quad-quotes again.


For the checkboxes, I'm not sure about what you're trying to do, but here's a stab at it.

Are you storing whether the user checked a box to the database? Easiest way to do this would be to use a 1 or 0 like parksie suggested. Then, when you retrieved the data, you could "check" a box like this:

Dim strChk629
Dim strChk691

strChk629 = "" (just for insurance)
strChk691 = "" (ditto)

...... getcher data right here, folks .....

if Err629 = 1 then
strChk629 = " checked "
end if
if Err691 = 1 then
strChk691 = " checked "
end if
Note: the above assumes you store the state of the checkboxes in separate fields. If you store the error number (629 or 691) in a single field and want to check the appropriate box, you can say:

select case ErrorCode
case 629
strChk629 = " ""checked"" "
case 692
strChk691 = " ""checked"" "
end select


Then the code for your checkboxes would look like this:

<input type="checkbox" name="error" value="629" <%=strChk629%>>Error 629</input>

<input type="checkbox" name="error" value="691" <%=strChk691%>>Error 691</input>


That should set the state of the checkboxes.

[This message has been edited by UncaDanno (edited 08-06-2000).]

Dang ol symbols.....

[This message has been edited by UncaDanno (edited 08-06-2000).]
UncaDanno is offline   Reply With Quote
Old 08-06-2000, 05:12 PM   #3
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
Post

That is perfect. Thank you.

I tried to set up the search statically because it made sense that I could write...

strSQL = "SELECT * FROM artsapimp where name = art", conn

That didn't work for some reason. I tried to substitute the end with the autonumber ID and search by that and it worked fine. This is that line.

strSQL = SELECT * FROM artsapimp where ID = 1", conn

That was fine. Does the autonumber part matter? That is the only difference.

Thanks for your help.



------------------
If you think an education is expensive...try ignorance.
artsapimp is offline   Reply With Quote
Old 08-07-2000, 05:00 AM   #4
Member (9 bit)
 
Join Date: Dec 1999
Location: Midland, NC, USA
Posts: 292
Post

The difference is that, autonumber being numeric, you don't need quotes around its value in your SQL select statement. Since name is a string, you do need quotes around its value in the SQL statement.

And remember that, if you are accessing most any other database (SQL, Oracle, etc), you need single instead of double quotes around string values.
UncaDanno is offline   Reply With Quote
Old 08-07-2000, 06:42 AM   #5
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
Post

That makes sense. Thank you very much.

------------------
If you think an education is expensive...try ignorance.
artsapimp is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:56 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0