Results 1 to 2 of 2

Thread: RecordCount

  1. #1
    Bjarte Guest

    Default RecordCount

    I hva this code:<BR><BR>dbname="data/data.mdb"<BR>Sted = request.form("Sted")<BR>dim iTeller<BR>iTeller = 1<BR>set con=server.createobject("adodb.connection")<BR>cnp ath="DBQ=" & server.mappath(dbname)<BR>con.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath<BR><BR>IF Sted = "" THEN<BR> sql="SELECT stasjon_ID,stasjon_navn,bf95 FROM tbStasjon ORDER BY bf95"<BR>ELSE<BR> sql="SELECT stasjon_ID,stasjon_navn,bf95 FROM spAlt WHERE kom_kode = &#039" & Sted & "&#039 ORDER BY bf95"<BR>END IF<BR><BR>set rs = con.execute(sql)<BR><BR>what do I write to get a recordcount different from -1?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: RecordCount

    Look for an article on named: "Recordset Object, the right kind of cursor for the right kind of job."<BR><BR>it&#039ll explain it all.<BR><BR> If u can&#039t find it, then try this one.<BR>========================================== ====================<BR>SQL_string_variable = "SELECT * FROM table_name"<BR>set ObjADORs = Server.CreateObject("ADODB.Recordset")<BR><BR>set ObjADORs.ActiveConnection = Your_ADOConnection_object<BR> SQL_string_Variable, Your_ADOConnection_object, adOpenStatic, adLockReadOnly<BR>Response.write(ObjADORs.RecordCo unt)<BR><BR>====================================== ==========================<BR><BR>That should work.<BR><BR> C ya.<BR><BR>OHHHHH!! I forgot, u need a file,, u can find it on 4guys.. I dunno exactly where, but if u can&#039t find it, e-mail me.<BR><BR>Mauricio Chavarriaga<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts