Bill is the *GUY* !

Results 1 to 5 of 5

Thread: Bill is the *GUY* !

  1. #1
    New ASP Guest

    Default Bill is the *GUY* !

    Code is here:<BR><BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR>&#060;%<BR>Dim obj_interbase_dbconn<BR>Dim obj_interbase_rec<BR>SET Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.op en "Interbase", "sysdba", "masterkey"<BR><BR>Set rec = Server.CreateObject("ADODB.Recordset")<BR>rec.Curs orLocation = adUseClient<BR>rec.Open "Select * from mytable", Conn,3,3<BR><BR>Response.Write obj_interbase_rec.RecordCount <BR><BR>Set obj_interbase_rec = Nothing<BR>Set obj_Interbase_DBCOnn = Nothing%&#062;<BR><BR>FYI: <BR><BR>It will take long time to get the number like this.<BR>( rec.GetRows is the same.)<BR><BR>"SELECT count(*) AS Counter FROM mytable" is more fast,<BR>BUT open the table 2 times. :(<BR><BR>Thank you Bill, Ak, MG and all !!!

  2. #2
    Join Date
    Dec 1969

    Default But...

    The problem with using a client side cursor is what I describe before: Now *all* the rows in the recordset must be transferred from the DB to the ADODB control before the count can take place. And *that* is why it is so slow!<BR><BR>Opening a table two time using a modern database is generally *not* a bad thing! Most modern DB engines tend to cache records pretty agressively, so if the records were fetched for the SELECT COUNT(*) then they will still be sitting in the cache and the next SELECT will be lightning fast.<BR><BR>HOWEVER... *IF* you have a primary key on that table, then more than likely SELECT COUNT(*) does *NOT* go look at the actual records in order to get the count! Instead, it just opens up the primary-key section of the DB and counts the keys for that table! (It might not even need to count, since it likely has count as a piece of info in the DB overhead.)<BR><BR>Naturally, this may not apply is you do a SELECT COUNT(*) ... WHERE, because the WHERE can force reading all the records. But then see my comments just above about caching. Shrug. So it&#039s probably not a bad thing, you see.<BR><BR>

  3. #3
    New ASP Guest

    Default I understand! Thank you, Bill.

    Thanks Bill!

  4. #4
    BP Guest

    Default RE: But...

    Bill, <BR><BR>It sounds like you have done alot with Interbase. I am new to Interbase and I am having big problems just trying to establish a connection. Here is the code I am using:<BR><BR>Dim objConn<BR>Dim objRS<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open "Test", "SYSDBA", "masterkey"<BR>objConn.Close<BR>Set objConn = Nothing<BR><BR>When I run the code I get this:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[INTERSOLV][ODBC InterBase driver]Optional feature not implemented. <BR><BR>I was wondering if you could tell me what ODBC driver that you are using. I would appreciate any help you could give to me.<BR><BR>The ODBC driver I have is from InterSolv, Inc. Version: dated 10/18/98.<BR><BR>I can be reached at<BR>Thanks alot.<BR>BP

  5. #5
    Join Date
    Dec 1969

    Default Interbase drivers?

    Actually, I haven&#039t done anything but one little test using Interbase, but one of the guys across the hall has helped me and knows a lot.<BR><BR>We are not using the Merant (Intersolv, same thing) drivers for Interbase, even though we use Merant for almost every other DB. We are using an ODBC driver developed as part of Interbase.<BR><BR>That drive you are using is pretty old, and I&#039d bet it is/was just a "Beta" driver when it came out.<BR><BR>However...<BR><BR>Looking at your code...<BR><BR>I *presume* that you get the error you showed on this line:<BR> &nbsp; &nbsp; objConn.Open "Test", "SYSDBA", "masterkey"<BR><BR>True? If so, then what "optional feature" could the message *possibly* be referring to? I would *bet* it means that it doesn&#039t handle a uid or password. No? So how about just giving a DSN? (You&#039d probably then have to configure the Interbase DB to allow anonymous access, or whatever the equivalent is.)<BR><BR>You could *try* doing:<BR><BR> &nbsp; &nbsp; objConn.Open "DSN=Test;uid=SYSDBA;password=masterkey"<BR><BR>bu t I wouldn&#039t bet on that making any difference.<BR><BR><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