Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
Hi to all, im from Spain and im using openspace at work and we are trying to connect to a mysql database and we have somo problems XD.
I have make the plugin using the Scol tutorial pdf and we configure the odbc connection with the mysql odbc connection at the port 3306. When i run the plugin on openspace it didnt work.
Anyone know how to do a connection with a bbdd.
Thanks for all.
Offline
Hi errichar.
The scol api for odbc work well (last time I used it).
I did not made a plugIT yet but if you have make one, don't hesitate to send it to us, we could add it in the next release.
Send the error log or the plugIt itself, i can't tell what doesn't work without that ^^
Offline
Thanks for the quick reply. I have this files for the plugit, they are a test before i create the plugin
cVM3d-sql.pkg
typeof db=SqlDB;;
fun deleteOb(inst)=
0;;
fun cbOpen(inst, from, action, param, reply)=
set db=SqlCreate _channel "basededatos" "root" "";
_DMSevent this (getPluginInstanceEvent inst "value") strbuild SqlRequest db "SELECT nombre FROM prueba where id=1;" nil nil;
SqlDestroy db;
0 ;;
fun newOb(inst)=
PluginRegisterAction inst "Run" @cbOpen;
setPluginInstanceCbDel inst @deleteOb;
0;;
fun IniPlug(file)=
PlugRegister @newOb nil;
setPluginEditor @dynamicedit;
0;;
eVM3d-sql
fun cbCloseEdit(ctrlconsulta)=
let getEdCtrlTextLineValue ctrlconsulta -> consulta in
["consulta" consulta]::
nil;;
fun dynamicedit(winstr, inst, viewstr) =
let [400 50] -> [iw ih] in
(
setEdWindowSize winstr iw ih;
let (getPluginInstanceParam inst "consulta") -> consulta in
let if consulta == nil then "Introducir consulta SQL" else consulta -> consulta in
let crEdCtrlLabel winstr 10 12 160 20 "Consulta" nil -> labelconsulta in
let crEdCtrlTextLine winstr 180 10 200 20 consulta nil EDWIN_RESIZE_MW -> ctrlconsulta in
(
[mkfun1 @cbCloseEdit ctrlconsulta nil];
);
);;
VM3d-sql.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PLUGIN name="Consulta SQL" version="1.0" type="misc">
<DESCRIPTION>Accede BBDD y realiza consulta</DESCRIPTION>
<HELP>http://www.openspace3d.com/documentation/fr/plugits/misc/openurlplugit.html</HELP>
<RESOURCE></RESOURCE>
<EDITOR>
<SCRIPT path="./eVM3d-sql.pkg" />
<PARAM name="consulta" type="value" />
</EDITOR>
<CLIENT minstance="true">
<SCRIPT path="./cVM3d-sql.pkg" />
<ACTION name="Run" />
<ACTION name="Set Consulta" />
<EVENT name="Value" />
</CLIENT>
</PLUGIN>
and in the MySQL connection ODBC:
Uploaded with ImageShack.us
The conection didnt start and it say that the object is empty.
And we use the wampserver.
Thanks for all and sorry about my poor english XD
Offline
Hi,
In your code, the database name is basededatos.
In your Connection parameters (ODBC conf), the "Data Source Name" is test.
You must have the same name than the Data Source Name. Try with "test" instead of "basededatos".
Offline
ok thanks i will try XD
Offline
Pages: 1