Home | Advertising Info21 USERS CURRENTLY ONLINE   
   Site Search Contact Us Friday, March 14, 2025  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 



We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: Re: Problem with updating database
From: Harlan
Date: 2/25/1999 9:24:55 AM
IP: 206.222.20.2



 

Could someone tell me what is wromg with the following code?
-it would have helped if you would have told
us what the error you get is, or problem is.
I've tried to get it work
for several hours and I'm pretty fed up with this... Please help me!
Btw. Sorry that those variables are in finnish. I hope it doesn't bother anyone.
-wow it sure makes it hard to understand ;)

<%
'on error resume next
'NEVER EVER on error resume next unless you are
'200% sure you know what you are doing!!!!
'do error checking instead!
id = Request.form("id")
yritys = Request.form("yritys")
toimiala = Request.form("toimiala")
osoite = Request.form("osoite")
postinumero = Request.form("postinumero")
toimipaikka = Request.form("toimipaikka")
puhelin = Request.form("puhelin")
fax = Request.form("fax")
www=Request.form("www")
email=Request.form("email")
yhteyshenkilo=Request.form("yhteyshenkilo")
'I'm going to assume all these variables are
'being set, and none of them are empty.
'you'll need to validate that both in the
'previous page, and on this one.
'you also need to make sure no one has entered
'a single quote (') into any of the lines.
'if they have you need to replace it with two
'of them so sql doesn't choke on it.

Set Conn = Server.CreateObject("ADODB.Connection")
'you need DSN= and I'm assuming this is an access
'database, if not you need: "DSN=;UID=;PWD="
Conn.Open "DSN=Yritys"
'your way of concatanating is fine, I just
'like they way this looks better ;)
SQLlause = "UPDATE Perus " & _
"SET Yritys='" & yritys & "'," & _
"Toimiala = '" & toimiala & "'," & _
"Osoite = '" & osoite & "'," & _
"Postinumero = '" & postinumero & "'," & _
"Toimipaikka = '" & toimipaikka & "'," & _
"Puhelin = '" & puhelin & "'," & _
"FAX = '" & fax & "'," & _
"WWW = '" & www & "'," & _
"EMail = '" & email & "'," & _
"Yhteyshenkilö ='" & yhteyshenkilo & "' " & _
"WHERE Tunniste=" & id
'this sql statment assumes the datatype for
'all the fields are text except the id field
'is numeric, you will want to double check that.

'you dont' need to return anything with an
'update statement.
Conn.Execute(SQLlause)

'really all I did was add DSN= to the Conn.Open()
if that doesn't do it.. you need to be more
spacific about your problem.

Previous Message


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com