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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't use update statement to connect to Access

Status
Not open for further replies.

chrisdq

Programmer
Nov 6, 2002
77
US
Hi,

I can't figure out why the update doesn't work from ASP while it works fine with the select statement.
Here is what is have for the update statement

Public function testUpdate
dim conn, rs, x, correctpass, username, sqlquery, SQL

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:/Inetpub/ set rs = Server.CreateObject("ADODB.recordset")

SQL = "UPDATE records " & _
"SET records.userid = '33dell' " & _
"WHERE records.username = 'dell'"
rs.Open SQL, conn

rs.close
conn.close
end function

I keep getting the error "No value given for one or more required parameters.
/kerdan/session-class.asp, line 85 which points to rs.Open SQL, conn.
Can anyone see why it doesn't work?
Thank for anyone can help.
 
How are ya chrisdq . . .

Try:
Code:
[blue]DoCmd.RunSQL SQL[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thanks TheAceman1.
I'm doing ok. How about you?

what do I replace with DoCmd.RunSQL SQL?

Could you please provide a sample of how to use your update query?

I just can't figure out it works for select statement but not update.

Thanks.
 
Have a look at the Execute method of the ADODB.Connection object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top