+ Reply to Thread
Results 1 to 4 of 4

Size Limit for ADO query?

  1. #1
    Registered User
    Join Date
    09-09-2005
    Posts
    8

    Size Limit for ADO query?

    We are running VB 6.0 using ADO to connect to an Oracle backend.
    It seems continuations are limited to about 24 lines, so my rather large query is strung out hundreds of bytes lengthwise.
    I'm getting an Oracle -923, from keyword not found where expected error.
    The query runs in Toad when I take out the " " & _ continuation characters so I think it's ok.
    Is there a byte restriction on the length of the ResultSet.open command, or a line length at which the query may be getting truncated?

    Thx

  2. #2
    Registered User
    Join Date
    09-09-2005
    Posts
    8
    Well - I figured out what was wrong... missing a space at the end so it looked like
    'last_col_to_selectfrom tbl1'

    I'm still curious if there are any editing limitations, or size for queries, etc...
    Also, is there another way to continue lines besides _ that will allow for > 25?

    Thx

  3. #3
    Stephen Bullen
    Guest

    Re: Size Limit for ADO query?

    Hi Cesw,

    > We are running VB 6.0 using ADO to connect to an Oracle backend.
    > It seems continuations are limited to about 24 lines, so my rather
    > large query is strung out hundreds of bytes lengthwise.
    > I'm getting an Oracle -923, from keyword not found where expected
    > error.
    > The query runs in Toad when I take out the " " & _ continuation
    > characters so I think it's ok.
    > Is there a byte restriction on the length of the ResultSet.open
    > command, or a line length at which the query may be getting truncated?


    When building lengthy SQL statements, I generally do something like the
    following:

    Dim sSQL As String

    sSQL = ""
    sSQL = sSQL & " SELECT Field1, Field2"
    sSQL = sSQL & " FROM Table"
    sSQL = sSQL & " WHERE Field1 > 200"

    Set rs = New ADODB.Recordset
    rs.Open sSQL, mConn

    Regards

    Stephen Bullen
    Microsoft MVP - Excel

    Professional Excel Development
    The most advanced Excel VBA book available
    www.oaltd.co.uk/ProExcelDev



  4. #4
    Tim Williams
    Guest

    Re: Size Limit for ADO query?

    Size limit for a single SQL statment in Oracle is quite large - either 32
    or 64 k I think.
    There's no limit on using _ as far as I know. You could always store the
    query in a file and use replace() to substitute parameter values for
    placeholder text.

    Tim

    --
    Tim Williams
    Palo Alto, CA


    "cesw" <[email protected]> wrote in message
    news:[email protected]...
    >
    > We are running VB 6.0 using ADO to connect to an Oracle backend.
    > It seems continuations are limited to about 24 lines, so my rather
    > large query is strung out hundreds of bytes lengthwise.
    > I'm getting an Oracle -923, from keyword not found where expected
    > error.
    > The query runs in Toad when I take out the " " & _ continuation
    > characters so I think it's ok.
    > Is there a byte restriction on the length of the ResultSet.open
    > command, or a line length at which the query may be getting truncated?
    >
    > Thx
    >
    >
    > --
    > cesw
    > ------------------------------------------------------------------------
    > cesw's Profile:

    http://www.excelforum.com/member.php...o&userid=27117
    > View this thread: http://www.excelforum.com/showthread...hreadid=466758
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1