User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 425,932 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,672 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1649 | Replies: 1
Reply
Join Date: Jan 2007
Posts: 10
Reputation: nekesa is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
nekesa nekesa is offline Offline
Newbie Poster

Troubleshooting No Error, No Insert: ASP to Access

  #1  
Jan 23rd, 2007
I hope someone can help me decide what is happening with this. It recognizes and carries out the select statement, will redirect to the proper place if entry is valid/invalid, but will not insert anything into the database. I first wanted an timestamp but am trying to troubleshoot backwards and simply enter text. Still no go. (Here is the code. First post. Hope I do this right)

  1. <%
  2. Dim conn,rs,strsql,sql_insert
  3. set conn = server.CreateObject("ADODB.Connection")
  4. set rs = server.CreateObject("ADODB.Recordset")
  5.  
  6. 'DSN less connection
  7. Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\shared\Casework.mdb"
  8.  
  9. strsql = "Select SSN From CWCT07 where SSN = '" & _
  10. Request.Form("SSN") & "'"
  11. set rs = conn.Execute (strsql)
  12.  
  13.  
  14. If (not rs.BOF) and (not rs.EOF) then
  15. sql_insert = "insert into CWCT07 (cps) values ('Yes')"
  16. 'response.Write(sql_Insert)
  17. set sql_insert = conn.Execute (sql_insert)
  18. Response.Redirect "http://cwpsalem.pdx.edu/staff/Index.html"
  19. else
  20. Response.Redirect "http://cwpsalem.pdx.edu"
  21. end if
  22.  
  23. response.write strsql
  24.  
  25. 'close the recordset
  26. rs.close
  27. set rs = nothing
  28.  
  29. 'close the connection
  30. conn.close
  31. set conn = nothing
  32. %>
  33. </script>

Thanks for any help.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2005
Location: Dubai,UAE
Posts: 36
Reputation: noman78 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
noman78's Avatar
noman78 noman78 is offline Offline
Light Poster

Re: No Error, No Insert: ASP to Access

  #2  
Jan 25th, 2007
hi there
it seems u r new to asp
here is ur mistake
instead of this
set sql_insert = conn.Execute (sql_insert)
use this
conn.Execute (sql_insert)

it will work
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 9:12 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC