User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 426,336 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 2,421 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 MySQL advertiser: Programming Forums
Views: 4769 | Replies: 6
Reply
Join Date: Feb 2006
Posts: 2
Reputation: screwrup is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
screwrup screwrup is offline Offline
Newbie Poster

Unable to insert data into database.

  #1  
Feb 16th, 2006
Hi guys, i hope u can help me solve this prob of mine. Im currently werking on this project and somehow im unable to insert this data into my database eventhough the data was being retrieved. Can anione help


<% option explicit %>
<% response.buffer = true %>

<%



Dim conn, recaffected, sql, qty, increment, updated, objRS, objRS2, name, productid

qty=1

increment=0
updated=0

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("dbProduct.mdb"))

set objRS = Server.CreateObject("ADODB.recordset")
set objRS2 = Server.CreateObject("ADODB.recordset")

objRS.Open "SELECT * FROM OrderTable WHERE shopperid=" & session("shopperid")" , conn
objRS2.Open "SELECT * FROM Product WHERE productid=" & request.querystring("productid"), conn


sql="INSERT INTO OrderTable(shopperid, productid, qty, increment, updated, pdt, startbid1)"
sql=sql & " VALUES "
sql=sql & "(" & session("shopperid") & ", "
sql=sql & objRS2("productid") & ", "
sql=sql & qty & ", "
sql=sql & increment & ", "
sql=sql & updated & ", "
sql=sql & objRS2("name") & ", "
sql=sql & objRS2("startbid") & ") "



on error resume next
response.Write(sql)
response.end
conn.Execute sql, recaffected
if err<>0 then
response.write("<br>Product is already included, <a href='desc2.asp'>try again</a>.")
else
response.redirect("buy2.asp")
end if


objRS.close
objRS2.close

conn.close

%>


Is it bcos of the session??
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Location: Dallas, TX
Posts: 481
Reputation: campkev is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: Unable to insert data into database.

  #2  
Feb 17th, 2006
well to start off with, you are passing recaffected as a parameter to conn.execute, but you never set it to any value
Reply With Quote  
Join Date: Feb 2006
Posts: 21
Reputation: conspiringfate is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
conspiringfate conspiringfate is offline Offline
Newbie Poster

Re: Unable to insert data into database.

  #3  
Feb 23rd, 2006
ok dude.. . email me.. .lets fix this... i understand your problem but i really dont wanna type out the code
Reply With Quote  
Join Date: Feb 2005
Posts: 354
Reputation: DanceInstructor is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 12
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: Unable to insert data into database.

  #4  
Feb 23rd, 2006
Originally Posted by conspiringfate
ok dude.. . email me.. .lets fix this... i understand your problem but i really dont wanna type out the code

Why not help her solve the problem here? If so then everyone else will have the opportunity to see the solution and learn something...
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote  
Join Date: Feb 2006
Posts: 2
Reputation: screwrup is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
screwrup screwrup is offline Offline
Newbie Poster

Re: Unable to insert data into database.

  #5  
Feb 23rd, 2006
I'm a SHE aniwae..
Reply With Quote  
Join Date: Feb 2006
Posts: 21
Reputation: conspiringfate is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
conspiringfate conspiringfate is offline Offline
Newbie Poster

Re: Unable to insert data into database.

  #6  
Feb 23rd, 2006
waits for email! lol
Reply With Quote  
Join Date: Dec 2003
Location: Marin County, CA
Posts: 6,439
Reputation: DMR will become famous soon enough DMR will become famous soon enough 
Rep Power: 18
Solved Threads: 339
Colleague
DMR's Avatar
DMR DMR is offline Offline
Wombat At Large

Re: Unable to insert data into database.

  #7  
Feb 25th, 2006
Originally Posted by conspiringfate
waits for email! lol
Please read our posting rules regarding requesting and/or offering help via any channels other than the forums. In accordance with those rules, please refrain from offering such assistance here in the future.

Thanks in advance for understanding.
"May the Wombat of Happiness snuffle through your underbrush."
- Ancient Aborigine blessing


Please do not contact me by email or PM for help. We're all volunteers here, and only have so much free time to dedicate to our efforts.

However, if I've been working on a thread with you already, and seem to have "forgotten" your thread, please do send me a message. I try not to let things slip through the cracks, but it does happen sometimes.
Reply With Quote  
Reply

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

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

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

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