Showing posts with label style. Show all posts
Showing posts with label style. Show all posts

Monday, March 12, 2012

How to use ODBC to find a record by key in a larger result set

I'm using SQL32.INC,SQLEXT32.INC etc for the first time. I have some code
working fine in a report style program and it's very fast. In Maintenance
programs, I need to find a specific record and/or scroll from there. I can
get the scrolling next and prior working ok and I can get the calling up a
single account ok but scrolling immediately after a single record rowset fin
d
only works if I issue another select statement for the entire file. Of cours
e
the first sqlfetch gets the first record and not the first record after the
one that was just on screen. In other words I need to know how to retain the
absolute row position in the file some way so my scrolling can start from
there.Briefly, you need to bind column 0 (the bookmark column). There are some
set up steps you need to take (Setting 'use bookmarks' values to ON, etc.)
I'm not sure how much experience you have, but you should be able to find
some useful information on http://msdn.microsoft.com by searching for "ODBC
BOOKMARK". For example, I found an interesting article at
http://msdn.microsoft.com/library/d...-us/odbc/htm/od
bcscrolling_by_bookmark.asp
| Thread-Topic: How to use ODBC to find a record by key in a larger result
set
| thread-index: AcW5Qb9KPSrQ97YTT32NMc+1qaZ1Iw==
| X-WBNR-Posting-Host: 70.61.11.50
| From: "examnotes" <BobMTenn@.discussions.microsoft.com>
| Subject: How to use ODBC to find a record by key in a larger result set
| Date: Wed, 14 Sep 2005 08:34:08 -0700
| Lines: 10
| Message-ID: <BFB597E8-F6B0-4541-8345-52B400B58E86@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.odbc
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2708
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| I'm using SQL32.INC,SQLEXT32.INC etc for the first time. I have some code
| working fine in a report style program and it's very fast. In Maintenance
| programs, I need to find a specific record and/or scroll from there. I
can
| get the scrolling next and prior working ok and I can get the calling up
a
| single account ok but scrolling immediately after a single record rowset
find
| only works if I issue another select statement for the entire file. Of
course
| the first sqlfetch gets the first record and not the first record after
the
| one that was just on screen. In other words I need to know how to retain
the
| absolute row position in the file some way so my scrolling can start from
| there.
|

How to use ODBC to find a record by key in a larger result set

I'm using SQL32.INC,SQLEXT32.INC etc for the first time. I have some code
working fine in a report style program and it's very fast. In Maintenance
programs, I need to find a specific record and/or scroll from there. I can
get the scrolling next and prior working ok and I can get the calling up a
single account ok but scrolling immediately after a single record rowset find
only works if I issue another select statement for the entire file. Of course
the first sqlfetch gets the first record and not the first record after the
one that was just on screen. In other words I need to know how to retain the
absolute row position in the file some way so my scrolling can start from
there.
Briefly, you need to bind column 0 (the bookmark column). There are some
set up steps you need to take (Setting 'use bookmarks' values to ON, etc.)
I'm not sure how much experience you have, but you should be able to find
some useful information on http://msdn.microsoft.com by searching for "ODBC
BOOKMARK". For example, I found an interesting article at
http://msdn.microsoft.com/library/de...us/odbc/htm/od
bcscrolling_by_bookmark.asp
| Thread-Topic: How to use ODBC to find a record by key in a larger result
set
| thread-index: AcW5Qb9KPSrQ97YTT32NMc+1qaZ1Iw==
| X-WBNR-Posting-Host: 70.61.11.50
| From: "=?Utf-8?B?Qm9iTVRlbm4=?=" <BobMTenn@.discussions.microsoft.com>
| Subject: How to use ODBC to find a record by key in a larger result set
| Date: Wed, 14 Sep 2005 08:34:08 -0700
| Lines: 10
| Message-ID: <BFB597E8-F6B0-4541-8345-52B400B58E86@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.odbc
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2708
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| I'm using SQL32.INC,SQLEXT32.INC etc for the first time. I have some code
| working fine in a report style program and it's very fast. In Maintenance
| programs, I need to find a specific record and/or scroll from there. I
can
| get the scrolling next and prior working ok and I can get the calling up
a
| single account ok but scrolling immediately after a single record rowset
find
| only works if I issue another select statement for the entire file. Of
course
| the first sqlfetch gets the first record and not the first record after
the
| one that was just on screen. In other words I need to know how to retain
the
| absolute row position in the file some way so my scrolling can start from
| there.
|

how to use non-basic ascii chars in stored proc paramter

hi all,

I have a stored procedure with a input parameter ( xml block).

sp: spGetAddr @.xmlText

the style of parameter @.xmlText looks like

<Param RestricBy="UserName IN ('Mayá', 'Bob')"/>

If I use non-basic ASCII character, just like 'á' in the parameter, the execution fails and I get 'The error description is 'An invalid character was found in text content.''

But this kind of special characters should be allowed in the name column of the database table.

If I use the htlm code '&#xE1" to replace 'á' in the parameter, then the execution of the stored procedure is fine. but how can I change all of the possible sepcial characters?

If somebody knows how to handle this issue, please help me. I'm pre-appreciated for all the idea and suggestion!

Thanks,

Jone

When you pass the parameter to the stored procedure, make sure to use an nvarchar string. For example:

N'<Param RestricBy="UserName IN ('Mayá', 'Bob')"/>'

Regards,

Galex Yen

how to use non-basic AscII character in Stored procedure parameter

hi all,

I have a stored procedure with a input parameter ( xml block).

sp: spGetAddr @.xmlText

the style of parameter @.xmlText looks like

<Param RestricBy="UserName IN ('Mayá', 'Bob')"/>

If I use non-basic ASCII character, just like 'á' in the parameter, the execution fails and I get 'The error description is 'An invalid character was found in text content.''

But this kind of special characters should be allowed in the name column of the database table.

If I use the htlm code '&#xE1" to replace 'á' in the parameter, then the execution of the stored procedure is fine. but how can I change all of the possible sepcial characters?

If somebody knows how to handle this issue, please help me. I'm pre-appreciated for all the idea and suggestion!

Thanks,

Jone

What happens when you preface the string with the unicode identifier [ N ]?

<Param RestricBy="UserName IN (N'Mayá', 'Bob')"/>

|||

Thanks for your reply.

after preface 'N', I still got the same error.

Any idea?

Thanks,

Jone

|||

Perhaps this will prove useful for you:

http://blogs.msdn.com/mrys/archive/2005/09/06/461682.aspx