Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AddNew - no error, but still not working

Status
Not open for further replies.

inqbus

Programmer
Apr 9, 2001
18
NZ
Hello...
I have been moving closer and closer to getting this, but now I have hit a wall.

When I Submit my Form I am no longer getting any error messages, which makes me think its working, but then when I check the Database to see my new record... nothing, no records have been added.

Any advice on where to start looking?
I can post related code if required...

Cheers,
nqbs
 
Let me just check my psychic powers mmmmmmmm.... Nope not working better post some code :eek:) Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
haha, I though you were ment to be good...
thanks for your help.

idQry = "SELECT * From Customers"
Set rsAdd = Server.CreateObject("ADODB.RecordSet")
rsAdd.ActiveConnection = strConnect
rsAdd.CursorType = adOpenDynamic
rsAdd.LockType = adLockBatchOptimistic
rsAdd.Source = idQry
rsAdd.Open()

rsAdd.MoveLast
if Err.Description <> &quot;&quot; then
Response.Write Err.Description
else
ConfirmId = rsAdd(&quot;Id&quot;) + 1
End If

rsAdd.AddNew
' rsAdd(&quot;Id&quot;) = ConfirmId
rsAdd(&quot;FirstName&quot;) = Request.Form(&quot;FirstName&quot;)
rsAdd(&quot;LastName&quot;) = Request.Form(&quot;LastName&quot;)
rsAdd(&quot;Email&quot;) = Request.Form(&quot;Email&quot;)
rsAdd(&quot;UserName&quot;) = Request.Form(&quot;UserName&quot;)
rsAdd(&quot;Password&quot;) = Request.Form(&quot;Password&quot;)
rsAdd.Update
rsAdd.Close
set rsAdd = Nothing

 
Well its quite late here so i may be missing something but...
You've commented out the ID field, if the ID field is just being incremented with each new record just make it a autonumber/increment field that way you can dispense with -
rsAdd.MoveLast
if Err.Description <> &quot;&quot; then
Response.Write Err.Description
else
ConfirmId = rsAdd(&quot;Id&quot;) + 1
End If

Are any of the fields required fields? If there is a chance that no data is passed this will cause your update to fail Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
One additional comment, if your using ms access than some of your fieldnames are probably reserved words (Password, username...) I don't have a reference list, but I have had that problem a few times.
-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
With enough resources, time, and coffee, anything is possible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top