Connection to Oracle using OLE DB

Results 1 to 3 of 3

Thread: Connection to Oracle using OLE DB

  1. #1
    John Leblanc Guest

    Default Connection to Oracle using OLE DB

    I am making a connection to Oracle using OLE DB instead of ODBC. The connection is working fine, but when I try to get a PageCount or recordcount on my recordset it displays a value of -1. I am aware that depending on the cursor type that it will display a value of -1, but I have tried all the cursor types. Here is my original connection string which worked. <BR><BR>Conn.Open "dsn=lawson;uid=uid;pwd=password;SERVER=servername ;" <BR><BR>When I changed it to the following connection string, I receive a pagecount or recordcount of -1. <BR><BR>Conn.Open "Provider=MSDAORA.1;Password=pwd;User ID=uid;Data Source=datasourcename;Persist Security Info=True" <BR><BR>Here is the rest of my code: <BR><BR>cmdTemp.CommandText = "SELECT * FROM table name" <BR><BR>cmdTemp.CommandType = 1 <BR>Set cmdTemp.ActiveConnection = conn <BR>rsRecordset.Open cmdTemp, , 3, 3 <BR><BR>Does anybody have any ideas? Any help would be appreciated. <BR><BR>John <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Connection to Oracle using OLE DB

    The MSDAORA provider with NEVER give you a recordcount. You can do a couple of things (in order of perference)...<BR><BR>dim rsRecordset,rsarray, reccount<BR>...<BR>rsRecordset.Open cmdTemp, , 3, 3 <BR>rsarray = rsRecordset.Getrows<BR>reccount = ubound (rsarray, 2) + 1<BR><BR>or use the OLEDB provider for ODBC drivers (less preferable)<BR><BR>conn.Open "Provider=MSDASQL.1;Driver={Microsoft ODBC for Oracle};UID=username;PWD=password;SERVER=servernam e;"<BR>

  3. #3
    John Leblanc Guest

    Default RE: Connection to Oracle using OLE DB

    Derek,<BR><BR>I appreciate your info that works great for the record count. I guess that it&#039s impossible to get a pagecount with MSDAORA. The only way would be to divide the number of records in the array by the page size and then use the round function. Do you have any other ideas? Greatly appreciated.<BR><BR>John

Posting Permissions

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