p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

proasp_codeclinic thread: Propably a simple problem...

Message #1 by "Morten Nordby" <morten@r...> on Mon, 7 Aug 2000 22:46:56 +0200
This is a multi-part message in MIME format.

Content-Type: text/plain;
Content-Transfer-Encoding: 8bit


Under the ?view order? link for my customers I?ve made a login similar to
the ?shopadmin? login. This because I want my customers to be able to not
only view the orders, but also the content in each order.
My problem is that I cant seem to get the ?SQL selection? in the
?shopc_displayorders? to function like I want it to.

Se code below:

Sub GenerateSQL
dim sqlproc
Dim sqlkunde
dim dbtable
dim cid
' Kommentert bort av Ingar
'MySql = "SELECT * from " & dbtable
'response.write "generated sql=" & mysql
cid = clng(strcustomerid)
MySql = "Select * from orders where ocustomerid=(21)"

if Proctype="" then
   sqlproc =" WHERE Oprocessed=1"
   if Proctype="All" then
     sqlproc =" WHERE oprocessed=" & Proctype
   end if
end if
Mysql = mysql & sqlproc
If sortfield<>"" then
   mysql=mysql & " order by " & sortfield & " " & sortupdown
end if
'Neste linje er lagt inn av Ingar
'Response.write "<br>" & mysql
End sub

My problem is how to retrieve the Customerid for the logged in user. This
instead of the number 21 which I have inserted to check if the SQL works
with a number.

I hope I?ve explained the problem well enough for someone to understans what
I mean, and that someone can help me with this.

Kind regards
Morten Nordby

  Return to Index