i’ve started to build a Helper App to make the process of creating prepared statements for Xojo’s various supported Database types easier.
Because i personally only use mySQL Servers, i need help from our community to finish the project. So i pushed the source to GitHub, so that you can help if you like to.
Please do not comment the quality of the current code. I am no just a hobbyist programmer and i know, my code is really, really “bad”. It took a lot of courage to make the source code public.
Zum fortsetzen habe ich zu wenig Ahnung von Prepared Statements. Ich habe gerade erst angefangen mich damit auseinander zu setzen. Dein Programm ist dabei eine groe Hilfe diese in Xojo zusammen zu bauen. Schade nur das man den Statement Typ ‘Select’ nicht auswhlen kann.
Prepared Statements sind sehr schnell erlernt und erlauben dann einen sehr übersichtlichen Code.
Das Prinzip ist sehr einfach:
[code]// Objekte Vorbereiten
Dim ps mySQLPreparedStatement
Dim rs As RecordSet
// Querrie vorbereiten
ps = Datenbank.Prepare ( "Select * FROM Tabelle WHERE Spalte=? AND Spalte LIKE ?.. ")
// Querrie Variablen mit Inhalten füllen
ps.Bind( 0, stringVariable.ConvertEncoding(Encodings.WindowsANSI) // Das Encoding muss natürlich zur Datenbank passen
ps.BindType(0, mySQLPreparedStatement.String)
…