Results 1 to 7 of 7

Thread: [No one help m] Oracle dsn problem..

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2003
    Posts
    38

    Red face [No one help m] Oracle dsn problem..

    I'm firstly using Access as backend to my project, i connect to access using system Dsn.It woking fine.

    Now i want to shift my database to oracle.So i created a System Dsn.I change only in my connection object, change its DSN to Oracle Dsn.Rest coding is same will it work

    I'm connecting to oracle using DSN my connection is created but it cannot count record from database.There are records in my table.My coding for open database and to count recored as follow


    code for connection opening

    DIM CON AS NEW ADODB.CONNECTION

    With Con
    .Mode = adModeReadWrite
    .Open "Provider=msdaora;" & _
    "DSN=store2;" & _
    "User Id=acme;" & _
    "Password=acme"
    END WITH


    code to open recordset

    RsUser.Open "select * from SUSER", Con, , , adCmdText

    if RsUser.RecordCount=0 then
    msgbox "No record"
    end if


    Can RecordSet.RecordCount will not work in oracle

    Plase help me
    Thanks lot
    Last edited by spsingh; Oct 12th, 2003 at 08:06 AM.

  2. #2
    Fanatic Member doofusboy's Avatar
    Join Date
    Apr 2003
    Posts
    526
    This is connection string I use to work with Oracle databases:

    Dim strConnection As String = _
    "Provider=MSDAORA.1;User ID=MyID;Password=MyPassword;" _
    & "Data Source =MyDatabaseService.MyDomain.com"
    Do canibals not eat clowns because they taste funny?

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2003
    Posts
    38
    will rs.recordCount will not work with oracle.if i use it return -1.There are records in my table.
    I used it with access it work well

    my source to open connection is

    Open "Data Source=store2;" & _
    "User Id=scott;" & _
    "Password=tiger"

    please help me to count records from oracle

  4. #4
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    It looks to me like you haven't set your cursortype in your ADO connection.
    By default it will use forward only which does not support recordcount.
    Use either adOpenKeyset or adOpenStatic as the CursorType.

    Mega.
    "If at first you don't succeed, then skydiving is not for you"

  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2003
    Posts
    38
    no i'm using cursor type adopenkeyset but still it return record count -1.
    Please help me to count record from oracle

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 2003
    Posts
    38
    I still not found any solution so please help.Is peet their

  7. #7
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    The CursorLocation could be causing the problem. By default CursorLocation is adServerSide, which will always return a RecordCount of -1. Access does not support ServerSide cursors. If you need the record count use a client cursor. Just make sure you understand the implications of using one over the other.

    RsUser.CursorLocation = adClientSide

Posting Permissions

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



Click Here to Expand Forum to Full Width