getrows?

Thats how you put it into an array, and close the recordset.

Or are you trying to get a unique value for SKU?

In that case you can either use a VBS routine to generate a code, check it
to see whether it exists (either by checking for an empty recordset ("select
SKU from records where SKU='<generated sku>'") or by doing it in T-SQL using
a while loop and the exists() function), then insert it.
You can also have an autoincrement field in SQL7 (and almost all RDBs) which
will start counting from the beginning field in steps of 1 (or whatever
number you choose).



[EMAIL PROTECTED]
-------------------------------------------------------
"Life must be lived as play."
- Plato (427 - 347 BC)
----- Original Message -----
From: "Sam Thompson" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 9:25 AM
Subject: Re: Defining a recorset as a variable


> I dont know what your asking for either, but maybe this is it?!?!:
>
>
> Dim Conn, RS, cnpath, SQL
> Set Conn = Server.CreateObject("ADODB.Connection")
> cnpath="DBQ=" & server.mappath("/database/instant.mdb")
> Conn.Open  "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath &
> ";pwd=******"
>
> Set objRS = Conn.Execute("SELECT SKU FROM YourTable")
>
> Cat = Request.QueryString("Cat")
> SubCat = Request.QueryString("SubCat")
> SKU = objRS("SKU")
>
>
>
> HTH
> Sam Thompson
> ----------------------------------------------
> 2cs Communications Ltd
> http://www.2cs.com
> [EMAIL PROTECTED]
> T: 01473 622263
> F: 01473 622515
> -----------------------------------------------
> ----- Original Message -----
> From: <Rob Lamb`" <[EMAIL PROTECTED]>>
> To: "ActiveServerPages" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 20, 2002 8:49 AM
> Subject: Defining a recorset as a variable
>
>
> > Hi
> >
> > I need to define a recorset as a variable.  I am really stuck and cant
get
> it right.  If I hard code the product number in I dont have a problem but
I
> need each product to have its unique number.
> >
> > I have connected to the database with an ADODB connection.
> >
> > Here is ny existing code please can someone advise me as what to do!
> >
> > <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
> > <%
> > Option Explicit
> > Response.Buffer = True
> >
> > Dim Cat, SubCat, header, SKU
> >
> > Cat = Request.QueryString("Cat")
> > SubCat = Request.QueryString("SubCat")
> > SKU = I need the record value here
> >
> >         Dim Conn, RS, cnpath, SQL
> > Set Conn = Server.CreateObject("ADODB.Connection")
> > Set RS = Server.CreateObject("ADODB.RecordSet")
> > cnpath="DBQ=" & server.mappath("/database/instant.mdb")
> > Conn.Open  "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath &
> ";pwd=******"
> > %>
> >
> > Thanks
> >
> > Rob
> > ---
> > You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
> > To unsubscribe send a blank email to
> %%email.unsub%%
> >
>
>
> ---
> You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to
%%email.unsub%%
>
>


---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to