About Valentina XCMD...

Ken Ray kray at sonsothunder.com
Sun May 16 20:35:41 EDT 2004


Andre,

> humm... how do I address the VCXMD directly? I put it into externals 
> property and reloaded the IDE, is this enought?

Here's the basics that I use - the rest you can get from the docs Jan
pointed you to:

global gValentinaInit,gMainDBRef

on StartupDB
  get Valentina("SetDebugLevel",3)
  if not(gValentinaInit) then
    get
Valentina("Init",20*1024*1024,YourMacLicenseCode,YourWindowsLicenseCode)
    if (it contains "ERROR") then
      put false into gValentinaInit
      -- Call your error handler here
    else
      put true into gValentinaInit
    end if
  end if
end StartupDB

on ShutdownDB
  if gValentinaInit then get Valentina("Shutdown")
  put false into gValentinaInit
end ShutdownDB

on OpenDB pDBPath
  put Valentina("Database_Open",pDBPath) into temp
  if (temp contains "ERROR") then
    -- call your error handler here
  else
    put temp into gMainDBRef
  end if
end OpenDB

on CloseDB
  get Valentina("Database_Close",gMainDBRef)
  put "" into gMainDBRef
end CloseDB

-- Then to make a simple query that gets all the data from the People table
put Valentina("Database_SQLSelectRecords",gMainDBRef,"SELECT * FROM People")
into tRecs


Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/




More information about the Use-livecode mailing list