Asked — Edited
Resolved Resolved by ptp!

Configuration Form When Creating A Plugin

I have went thru the tutorial for the plugin and have successfully created a basic plugin. Now I want to go the next step and create a plugin that has a configuration page that is accessed by clicking the gear icon but can not figure out how to do it.

The plugin I hope to create will allow the user to create a connection to a database using a DSN.

RichardZ

Update: One Step Closer - I found the UCConfigurationButton

Update2: Stumbled upon ptp's testplugin on github and creating a ConfigForm.cs using it as my example.


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

PRO
USA
#25  

@DJ, Thank you DJ that now makes sense. I will look when I get home this evening.

@ptp, Thank you so much. I will study the code and add to my plugin project as a learning experience.

I will post how it all goes on Thursday after the site comes back up.

RichardZ

PRO
USA
#26  

@ptp, I tried your plugin and all I can get is the number of hits the query received not the actual data.


$Connection = "System.Data.Odbc|DSN=EZBrain;"
$sql = "Select MemoryName from MemoryAtom where MemoryType = 1"
$Results = DataQuery($Connection, $sql)
print($Results)


Start
> 97
Done (00:00:00.1249936)


PRO
USA
#27  

Check the last example.

The function returns the number rows.

Your data is in the array variable $data_0

Add the variable monitor control and you will see the data there.

PRO
USA
#28  

AWESOME! Thank you I looked at all examples but that one was using a different data provider so I just looked over that.

This is great ptp, thank you so much. when I complete the database brain I owe you a copy.

RichardZ

PRO
USA
#29   — Edited

@ptp,

When trying to insert a record using

$sql = "INSERT INTO MemAtom (MemType, MemData) VALUES (7, '" + $varSTR1 + "')"

$varSTR1 equals one of the 2 lines.

The first line inserts correctly, the second gives me an error Syntax error (missing operator).

  1. All the men of thy confederacy have brought thee even to the border: the men that were at peace with thee have deceived thee, and prevailed against thee, that they eat thy bread have laid a wound under thee: there is none understanding in him.

  2. All the Nethinims, and the children of Solomon's servants, were three hundred ninety and two.

I wrote a VBScript to do the same thing and get the same result that tells me it is not a bug but something with my insert statement but I can not figure it out.

I can paste the line into the database just fine.

Any guess as to what my issue is? with the insert statement I mean.

RichardZ

PRO
USA
#30   — Edited

@rz90208:

SQL Strings use single quotes. If your $varSTR1 contains a single quote will break the query.

That is the reason why I've implemented parameterized queries, at least for strings and numbers it will work (ez-script supported types).

using a parameterized query parameter @0:


$sql="INSERT INTO Table1([Str1]) VALUES(@0);"

$string1="Test is a test"
DataQuery($connection, $sql, 10, "$myData", $string1)

$string2="For 'single quotes' you will need parameterized queries."
DataQuery($connection, $sql, 10, "$myData", $string2)

PS: The forum is still in beta mode and is crippled i know the things will be fixed soon or later, for faster responses drop me an email : tiago.private AT gmail.com.

PRO
USA
#31  

@ptp

That worked. I edited my source document and changed all ' to nothing saved the doc and all imported without error.

Not the best solution but will work. I don't think the robot will speak the word any different

Servent's or Servents

Thank you again

PRO
USA
#32  

@PTP is this addon still working? I get an error when trying to use in.


$Connection = "System.Data.Odbc|DSN=EZBrain;"
$sql = "Select MemoryName from MemoryAtom where MemoryType = 1"
$Results = DataQuery($Connection, $sql)
print($Results)

Start

Error on line 3: Unknown function: DataQuery. Done (00:00:00.0048909)