|
 |
access_asp thread: Trouble adding row with recordset
Message #1 by "Edward T. Owens" <dagger1@c...> on Thu, 31 Oct 2002 07:54:50
|
|
Hi,
I'm relatively new to asp and having difficulties with writing data to
the database. My connection string is good since I can read the data. I
think maybe it has something to do with the primary key is an auto
Incrementing field. Does this field update itself or do I have to include
it in the addnew, update phase? For instance the primary key is before
the UserName field but I left it out thinking that it would autoincrement
that field automatically when using addnew update.....here is the code
If Not bolMatchFound then
objRS.AddNew
objRS("UserName") = Trim(Request.Form("UserName"))
objRS("FirstName") = Trim(Request.Form("FirstName"))
objRS("ICQ") = Request.Form("ICQ")
objRS("Email") = Trim(Request.Form("Email"))
objRS("Committee") = Request.Form("Committee")
objRS("Comment") = Trim(Request.Form("Comment"))
objRS("misc") = "some data"
objRS("Status") = "Active"
objRS("PassCode") = Trim(Request.Form("PassCode"))
objRS.Update
strFailed = "You can now login...."
Else
Session("AuthCount") = Session("AuthCount") + 1
End if
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
Dagger
Message #2 by "Edward T. Owens" <dagger1@c...> on Thu, 31 Oct 2002 08:20:07
|
|
Sorry I forgot to mention the error I was receiving..
HTTP 500 - Internal server error
Internet Explorer
> Hi,
I> 'm relatively new to asp and having difficulties with writing data to
t> he database. My connection string is good since I can read the data. I
t> hink maybe it has something to do with the primary key is an auto
I> ncrementing field. Does this field update itself or do I have to
include
i> t in the addnew, update phase? For instance the primary key is before
t> he UserName field but I left it out thinking that it would
autoincrement
t> hat field automatically when using addnew update.....here is the code
> If Not bolMatchFound then
> objRS.AddNew
> objRS("UserName") = Trim(Request.Form("UserName"))
> objRS("FirstName") = Trim(Request.Form("FirstName"))
> objRS("ICQ") = Request.Form("ICQ")
> objRS("Email") = Trim(Request.Form("Email"))
> objRS("Committee") = Request.Form("Committee")
> objRS("Comment") = Trim(Request.Form("Comment"))
> objRS("misc") = "some data"
> objRS("Status") = "Active"
> objRS("PassCode") = Trim(Request.Form("PassCode"))
> objRS.Update
> strFailed = "You can now login...."
E> lse
> Session("AuthCount") = Session("AuthCount") + 1
E> nd if
o> bjRS.Close
S> et objRS = Nothing
o> bjConn.Close
S> et objConn = Nothing
> Dagger
|
|
 |