Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript ADO Problems Access Database

Status
Not open for further replies.

robotman757

Programmer
Jan 3, 2003
14
US
I have tried a few different attempts to get form data inserted into my db to no avail. The form that is submitted is dynamically created and could have several hundred form elements. I can get the values into an array and that is working fine. The 2 arrays I have are called fields and fieldval[x] fields never changes, but fieldval represents a different row in the table. The arrays work fine, but I can't seem to loop the array and insert the data into the database. I know the db opens and closes correctly. Any ideas?!! Or examples??
 
not sure about the exact jscript equivalent since i use vbscript, but i do it like so (approximately):

set rs = server.createobject("adodb.recordset")
rs.open "select top 0 from myTable", cn, adOpenStatic, adLockPessimistic, adCmdText

rs.addnew()

for x = 0 to ubound(fieldval)
rs("columnName") = fieldval(x)
next

rs.update()

set rs = nothing



=========================================================
while (!succeed) try();
-jeff
 
Thank you for the response, but I fixed my problem after posting this message. I forgot to come back and post it was fixed!! I had been using vbscript when I first started writing asp pages, but I have learned to like just how much you cn do with javascript!! I will now use javascript for both client and server scripting!!
 
What would the exact syntax be for Javscript? I think I can use this... Thanks, Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top