ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 17th, 2003, 05:08 PM
yanivn yanivn is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 12 yanivn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy db read/write/update

Hi, i looked in faq and didn't find a thing.
i wrote ths simple code that finds the index with read from db, and write new entry to db. simple ? yes. working ?.....
it gives me problems with the update stuff bellow. what do i do ? please ???
i hope it's not too messy - the code:

dsnStr = "DSN=InfoTechIncDB;"
' start read connection
set readQuery = Server.CreateObject("ADODB.RecordSet")
'get next id
query = "SELECT max(customer_id)+1 as new_customer_id FROM t_customer_details"
readQuery.Open query , dsnStr
curId = readQuery("new_customer_id")
readQuery.Close
' start read connection
set writeQuery = Server.CreateObject("ADODB.RecordSet")
'Set the cursor type we are using so we can navigate through the recordset
writeQuery.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
writeQuery.LockType = 3
query = "INSERT INTO t_customer_details(customer_id,first_name,last_name,day_phone,email) " & "VALUES('" & curId & "','" & Request.form("fName") & "','" & Request.form("lName") & "','" & Request.form("dPhone") & "','" & Request.form("email") & "')"
writeQuery.Open query , dsnStr
'Write the updated recordset to the database
writeQuery.Update
writeQuery.Close

God bless yur code, whoever helps.

Reply With Quote
  #2  
Old November 17th, 2003, 06:36 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,959 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 15 h 59 m 14 sec
Reputation Power: 802
What is the problem? If you post details it will be easier to determine how to help

Reply With Quote
  #3  
Old November 19th, 2003, 01:17 AM
yanivn yanivn is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 12 yanivn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks. i sorted it.

some syntax issues

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > db read/write/update


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT