|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
What is the problem? If you post details it will be easier to determine how to help
|
|
#3
|
|||
|
|||
|
thanks. i sorted it.
some syntax issues
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > db read/write/update |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|