Scolring - Forum

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.

#1 24-Jun-2011 14:05:23

errichar
Member
Registered: 14-May-2011
Posts: 14

Help with sql plugin on openspace3d

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

#2 24-Jun-2011 16:51:24

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: Help with sql plugin on openspace3d

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

#3 25-Jun-2011 01:18:14

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Help with sql plugin on openspace3d

A DB via ODBC, ok. But make a plugIt without knowing what you want ... smile

Offline

#4 28-Jun-2011 10:24:02

errichar
Member
Registered: 14-May-2011
Posts: 14

Re: Help with sql plugin on openspace3d

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:

odbc.jpg

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

#5 28-Jun-2011 11:00:36

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Help with sql plugin on openspace3d

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

#6 28-Jun-2011 11:09:03

errichar
Member
Registered: 14-May-2011
Posts: 14

Re: Help with sql plugin on openspace3d

ok thanks i will try XD

Offline

Board footer

Powered by FluxBB