newbie question

A

Auddog

I'm passing a variable in a Request.QueryString and now I'm wanting to
insert that variable into my database along with other information from the
form. All the other inserts use something like this adoRS("fk_projectid") =
Request.Form("title"). I just can't seem to get the varibale that I pass
into the database. Below is my code

<%
DIM adoDB, adoRS, objConn, id
id = Request.QueryString("id")
' Create the Database Object, and connect to it
Set adoDB = Server.CreateObject("ADODB.Connection")
adoDB.Open strConnection
' Create the Recordset Object
Set adoRS = Server.CreateObject("ADODB.RecordSet")
adoRS.Open "ShopLog", adoDB, adLockOptimistic, adCmdTable

adoRS.AddNew
adoRS("fk_projectid") = Request.Write("id")
adoRS("sd_title") = Request.Form("title")
adoRS("copies") = Request.Form("copies")
adoRS("duedate") = Request.Form("duedate")
adoRS.Update

' Tidy up afterwards
adoRS.Close
Set adoRS = Nothing
adoDB.Close
Set adoDB = Nothing
%>
 
B

Bob Lehmann

What's this - Request.Write("id") ?

Did you mean Request.Querystring("id") ?

Bob Lehmann
 
A

Auddog

That is what I was trying, but it wouldn't work - Should I be using a
Request.Querystring("id") ?

A
 
A

Auddog

I review the website, but I'm not sure what to call I'm looking for. I
tried the Request.Write, but that doesn't work - it will fill out the rest
of the database items, just not the fk_projectid. Thanks for any help you
can offer.

A


"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
 
B

Bob Lehmann

I see what you're doing now. It should just be....
adoRS("fk_projectid") = id

Bob Lehmann
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,274
Latest member
JessMcMast

Latest Threads

Top