Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Error with "seek" command from Visual Studio (Visual Basic)

3 posts in OLEDB Last posting was on 2008-05-06 21:38:26.0Z
Gabriel Posted on 2008-04-16 22:21:55.0Z
From: "Gabriel" <gaureli@gmail.com>
Newsgroups: advantage.oledb
Subject: Error with "seek" command from Visual Studio (Visual Basic)
Date: Thu, 17 Apr 2008 00:21:55 +0200
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 85.58.58.63
Message-ID: <48067a72@solutions.advantagedatabase.com>
X-Trace: 16 Apr 2008 16:15:14 -0700, 85.58.58.63
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!85.58.58.63
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1267
Article PK: 1133787

I try to use the "seek" command with a .DBF file with a .NTX index.
The key is formed by 3 fields: str(field1, 6) + str(field2,5) + str(field3,
8)

oRFac = New ADODB.Recordset

oConn.Provider = "Advantage.OLEDB.1"

oConn.Properties.Item("Data Source").Value = stDatos

oConn.Properties.Item("Advantage Server Type").Value = "ADS_LOCAL_SERVER"

oConn.Properties.Item("Advantage Table Type").Value = "ADS_NTX"

oConn.Open()

oRFac.Open("MTFACTU", oConn, ADODB.CursorTypeEnum.adOpenStatic)

oRFac.Index = "MTFACTT"

If i try this:

Dim key As String() = {123456, 12345, 12345678}
oRFac.Seek(key)

the systems returns a "type mismatch error"

And if i try this,

Dim key As String

key = "123456"

oRFac.Seek(key)
the system returns a "Error 5179: The result value exceeded the given
buffer size. AdsSetField"



How i can access with the "seek" command to an index with more than one
field key??



Thanks for all, from Spain, and congratulations for this "news" and for your
ADS product !!!


Mark Wilkins Posted on 2008-04-17 17:05:15.0Z
From: "Mark Wilkins" <mark@no.email>
Newsgroups: advantage.oledb
References: <48067a72@solutions.advantagedatabase.com>
Subject: Re: Error with "seek" command from Visual Studio (Visual Basic)
Date: Thu, 17 Apr 2008 11:05:15 -0600
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 10.24.38.228
Message-ID: <480781f4@solutions.advantagedatabase.com>
X-Trace: 17 Apr 2008 10:59:32 -0700, 10.24.38.228
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.228
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1268
Article PK: 1133788

Hi Gabriel,

The parameters to the Seek method need to match the actual data types. In
other words, if field1 is numeric, then the seek value corresponding to that
field must be numeric (rather than a string). Advantage will build the key
correctly from the given values. For example, the following should work:

oRFac.Seek Array(123456, 12345, 12345678 ), adSeekFirstEQ

Mark Wilkins
Advantage R&D

"Gabriel" <gaureli@gmail.com> wrote in message
news:48067a72@solutions.advantagedatabase.com...
>I try to use the "seek" command with a .DBF file with a .NTX index.
> The key is formed by 3 fields: str(field1, 6) + str(field2,5) +
> str(field3, 8)
>
>
> If i try this:
>
> Dim key As String() = {123456, 12345, 12345678}
> oRFac.Seek(key)
>

...


Gabriel Posted on 2008-05-06 21:38:26.0Z
From: "Gabriel" <gaureli@gmail.com>
Newsgroups: advantage.oledb
References: <48067a72@solutions.advantagedatabase.com> <480781f4@solutions.advantagedatabase.com>
Subject: Re: Error with "seek" command from Visual Studio (Visual Basic)
Date: Tue, 6 May 2008 23:38:26 +0200
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 90.162.99.39
Message-ID: <4820ce30@solutions.advantagedatabase.com>
X-Trace: 6 May 2008 15:31:28 -0700, 90.162.99.39
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!90.162.99.39
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1277
Article PK: 1133797

Hi Mark, You're right, the fields for the Seek method must be numeric.

Thanks for your answer.

"Mark Wilkins" <mark@no.email> escribi? en el mensaje
news:480781f4@solutions.advantagedatabase.com...

> Hi Gabriel,
>
> The parameters to the Seek method need to match the actual data types. In
> other words, if field1 is numeric, then the seek value corresponding to
> that field must be numeric (rather than a string). Advantage will build
> the key correctly from the given values. For example, the following
> should work:
>
> oRFac.Seek Array(123456, 12345, 12345678 ), adSeekFirstEQ
>
> Mark Wilkins
> Advantage R&D
>
> "Gabriel" <gaureli@gmail.com> wrote in message
> news:48067a72@solutions.advantagedatabase.com...
>>I try to use the "seek" command with a .DBF file with a .NTX index.
>> The key is formed by 3 fields: str(field1, 6) + str(field2,5) +
>> str(field3, 8)
>>
>>
>> If i try this:
>>
>> Dim key As String() = {123456, 12345, 12345678}
>> oRFac.Seek(key)
>>
> ...
>