If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > inserting not working, but no errors

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-09-03, 14:03
CityInet.com CityInet.com is offline
Registered User
 
Join Date: Nov 2002
Posts: 8
inserting not working, but no errors

I am trying to insert some data from my asp but am having no luck. I am using Access 2002 and I have succesfuuly queried the database with a select statement from my asp.

I know the insert statement works because I have run it directly on Access. However, whenever I run it from my asp, I get a blank screen returned; afterehich, when I query the DB to see if the row was inserted. It is not there...Please help!

Here is my code..
----------------
'Get next sequencial value from db
sSql = "select max(testimonial_id)+1 as nexval from testimonials"
objcmd.CommandText = sSql
set rs = objcmd.Execute
nexval = rs.Fields("nexval").Value
set cmd = nothing

sSql = "insert into testimonials values(6, 'test6th@home.com', 'test', 0)"
objcmd.Execute
---------------
it is acting as if the second objcmd.execute is never executing
Reply With Quote
  #2 (permalink)  
Old 08-11-03, 02:55
Memnoch1207 Memnoch1207 is offline
Registered User
 
Join Date: Jan 2003
Location: Midwest
Posts: 138
im assuming that you are setting the objcmd (not cmd) to nothing in the bolded line below??? if you are setting objcmd to nothing, then you can't possibly execute the insert command.
Code:
'Get next sequencial value from db
sSql = "select max(testimonial_id)+1 as nexval from testimonials"
objcmd.CommandText = sSql
set rs = objcmd.Execute 
nexval = rs.Fields("nexval").Value 
set cmd = nothing 

sSql = "insert into testimonials values(6, 'test6th@home.com', 'test', 0)"
objcmd.Execute
it should be something like this
Code:
'Get next sequencial value from db
sSql = "select max(testimonial_id)+1 as nexval from testimonials"
objcmd.CommandText = sSql
set rs = objcmd.Execute 
nexval = rs.Fields("nexval").Value 


sSql1 = "insert into testimonials values(6, 'test6th@home.com', 'test', 0)"
objcmd.CommandText = sSql1
objcmd.Execute 

set objcmd = nothing

Last edited by Memnoch1207; 08-11-03 at 02:58.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On