YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

ODBC and placeholder Options · View
tina01
#1 Posted : Tuesday, October 18, 2011 4:35:58 AM
Rank: Newbie
Groups: Member

Joined: 10/18/2011
Posts: 1
Location: U.S
I understand how to use placeholder in odbc in processbook. But I'd like to go a little bit further, for instance, one of the placeholder is text. But it's kind of aweful to go in odbc to change the text everytime. Is there a way that I place the text on the display, which allow users easy access to change. I think this need to done through VBA. Can everyone give me a hint to start with? Thanks in advance
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
caffreys_col
#2 Posted : Tuesday, October 25, 2011 2:19:06 PM
Rank: Advanced Member
Groups: Member

Joined: 4/6/2011
Posts: 40
Location: Grimsby UK
What exactly are you trying to do?? If you want to edit the ODBC query everytime then you could probably do this using VBA. Create a text entry on screen which shows the basic structure of the query then, in the spaces you want the user you be able to enter their own text, put a textbox (a drop down box would be better to limit the number of entries and remove the possibility for finger trouble!).
Something like ..." select * from " textbox1 "where tag = " textbox2 etc,etc

Put a command button on the processbook display and then put some VBA code behind it that creates the query string and uses it. eg.
Dim strquery as String
strquery = "select * from " & textbox.1value & "where tag = " textbox2.value
obdc.query = strquery

or something similar (I can't remember the full syntax required but it's not too far from that I think)

Hope this is what you were looking for!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.