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.

JavaScript Forum


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



Reply
Recordset problems... attempting to add record to db
Old 05-22-2006, 05:50 PM Recordset problems... attempting to add record to db
Junior Talker

Posts: 1
Trades: 0
I'm running javascript client side over a Lan. I want to run write the results from a form into an Access 97 db.

I am currently getting the following error: "No Value given for one or more required parameters." However, I added an alert message to confirm sql statement and its values were correctly being sent.

I'm now starting to think there is something wrong with my 'rst.open' statement.
Currently nothing is writing to database fields. I'm rather new to this and learning as I go. Can someone plz tell me what I am missing?

<SCRIPT type=text/javascript>

function CheckPassword(){
var polnum
var appnam
var relshp
var rst
var conn
var sql

polnum = document.main.PWD1.value;
appnam = document.main.appnam.value;
relshp = document.main.relshp.value;

rst = new ActiveXObject("ADODB.Recordset");
conn = new ActiveXObject("ADODB.Connection");
conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\\\server\\folder\\TESTDB.mdb");
sql = "INSERT INTO TBL_REFERRALS (REFNO, APPNAME, UWRTR) VALUES (" + polnum + ", " + appnam + ", " + relshp + ")";
alert(sql);

rst.Open (sql, conn, 1, 3);

alert("It worked!!");

rst.Close;
conn.Close;
}
</script>
AnicoJoe is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-22-2006, 06:28 PM Re: Recordset problems... attempting to add record to db
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
I don't know what your doing, but if your using Ajax to pass sql commands - That SOUNDS DANGERIOUS!
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is online now
Reply With Quote
View Public Profile
 
Old 05-23-2006, 04:15 AM Re: Recordset problems... attempting to add record to db
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,528
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you can't open a server-side database with client-side javascript
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Recordset problems... attempting to add record to 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.21920 seconds with 12 queries