Russia Forums Community


Go Back   Russia.com Discussion Forum > Open Board > Science
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 30th October 2002, 23:16
BlackJetta BlackJetta is offline
Member
 
Join Date: Oct 2002
Posts: 36
Exclamation

Hi, everybody...
Straight ahead, I'm looking for someone who has had an experience with using bind variables with ADO and VB6. I'm trying to pass the list of parameters on the where - in () clause as a string into a bind variable, such as this:

...

Set objCn = New ADODB.Command
Set objRs = New ADODB.Recordset

objCm.Parameters.Append _
objCm.CreateParameter( "prVar3", adVarChar, adParamInput, 100, "'blah1', 'blah2', 'blah3'" )

strSql = " SELECT * FROM table "
strSql = strSql & " WHERE param in ( : prVar3)"

...

objCm.CommandType = adCmdText
objCm.CommandText = strSql
Set objRs = objCm.Execute


After the execution of the command, the recordset objRs is not returned any records.

However, if I run the SQL query directly in TOAD like htis:

SELECT * FROM table
WHERE param in ('blah1', 'blah2', 'blah3')

I have so many records returned.

NOTE: I did test the code with the other cases, such as using this

objCm.Parameters.Append _
objCm.CreateParameter( "prVar3", adVarChar, adParamInput, 100, "blah1" )

and had the records returned into the recordset.

Any ideas? May be someone had to deal with something like that?
Oracle FAQ seems to be helpless (it also states that I cannot use explicitly declared bind variables with ADO, but question marks (?) only, which, as it turned out, I can...)

Thanks in advance!!!

Reply With Quote
  #2 (permalink)  
Old 31st October 2002, 00:07
old-reb old-reb is offline
Former Member
 
Join Date: Jan 2001
Posts: 4,491
Not a clue

Hello BlackJetta,

I don't have a clue but here are some folks that may be able to help you or at least send you to a place for help.

http://www.duxcw.com/yabbse/index.php#2

old reb
Reply With Quote
  #3 (permalink)  
Old 31st October 2002, 00:31
BlackJetta BlackJetta is offline
Member
 
Join Date: Oct 2002
Posts: 36
Thanks!

Quote:
Originally posted by old-reb
Hello BlackJetta,

I don't have a clue but here are some folks that may be able to help you or at least send you to a place for help.

http://www.duxcw.com/yabbse/index.php#2

old reb
Thanks, Old-Reb!
Hopefully, they'll answer it there
I made these "bind variables" working in general, but this particular task.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +3. The time now is 21:36.

All Rights Reserved © 1995 - | NewMedia Holdings, Inc. The Russia Channel is operated under license to Paley Media, Inc. which is solely responsible for its content. All trademarks and web sites that appear throughout this site are the property of their respective owners. No part of this site shall be reproduced, copied, or otherwise distributed without the express, written consent of Paley Media, Inc. This site is not affiliated with any government entity associated with a name similar to the site domain name.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC4 © 2006, Crawlability, Inc.