Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Problem adding record to access db
Old 11-13-2006, 11:39 AM Problem adding record to access db
Junior Talker

Posts: 1
Name: Cooper
Trades: 0
I've created an admin function to handle a "picture of the week" off our index, and im trying to update the db with the inputted data: weekStart, weekEnd, sourceFile. The name of the database is dB.mdb and is in the same folder as the file. The name of the table is pow and has the following columns: id (number, indexed with no duplicates), weekStart (text), weekEnd (text), sourceFile (text).

The code below is after the form had been submitted...i cross checked the values in the form to the variables in the function, it all matches. the getid function just querys the database, returns records, and adds one. With the code below i get the following error:

Microsoft JET Database Engineerror '80040e10'
No value given for one or more required parameters.
/pow/pow.asp, line 18


view code:

if request.querystring("action") = "process" then

w_start = request.form("month") & "/" & request.form("day") & "/" & request.form("year")
w_end = request.form("month2") & "/" & request.form("day2") & "/" & request.form("year2")

id = getid()

SQL="insert into pow (id,weekStart,weekEnd,sourceFile) VALUES (" & id & "," & w_start & "," & w_end & "," & request.form("source") & ")"

sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & server.mappath("dB.mdb")

Set connection = Server.CreateObject("ADODB.Connection")
connection.Open(sConnString)
connection.execute(SQL)
Connection.Close
Set Connection = Nothing

end if

###

Any help would be greatly appreciated.

Thanks in advance
cooperljrh is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-13-2006, 01:49 PM Re: Problem adding record to access db
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
response.write out the SQL string before calling execute so you can see what is being sent to the server and post the output here if you cannot see a problem.


Text values in the string should be surrounded with single quotes otherwise the Access driver could be taking the "/" as a divide operation.
Date literals should be surrounded with "#" as well if you are using date type fields.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Problem adding record to access db
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25057 seconds with 12 queries